Re: ~/.bashrc problem

From: Olive (olive.lin_at_versateladsl.be)
Date: 04/15/05

  • Next message: Jon Dowland: "Re: file cp"
    Date: Fri, 15 Apr 2005 15:33:53 +0200
    To: debian-user@lists.debian.org
    
    

    Kuang He wrote:
    > 2005/4/15, Robert Vangel <robert@vangelr.net.au>:
    >
    >>Using " should work, or if you want a literal " you would use \" but
    >>this would break it...
    >
    >
    > Using " works most of the time, but, if you encouter some URL like
    > http://bbs.ustc.edu.cn/cgi/sf?bid=260&aof=M425dea7e&fn=23.jpg
    > It does not work properly.

    The fact is that you must convice bash to pass the url to wget without
    modification.

    Let's see a few examples

    [oesser@logic-pc1 ~]$ a="hello"
    [oesser@logic-pc1 ~]$ echo "$a"
    hello

    However the expansion is done only once; characters inside the variable
    a itself is not expanded anymore:

    [oesser@logic-pc1 ~]$ hello="good morning"
    [oesser@logic-pc1 ~]$ a='$hello' # character inside single quote are
                                          # not expanded
    [oesser@logic-pc1 ~]$ echo "$a" # expand the variable $a but once
                                          # it is done do not try to expands
                                          # the variable $hello
    $hello

    So if you use "$1" it will work whatever characters are present in $1.
    But if you use a URL directly written on the command line, not stored in
    a variable; you must enclose it in single quote to prevent expansion of
    "variables" which might be present in the URL.

    Olive

    -- 
    To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org 
    with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
    

  • Next message: Jon Dowland: "Re: file cp"

    Relevant Pages

    • Re: innerHTML = responseText generates invalid chars
      ... Actually the single quote is some sort of backward single quote. ... There are also other characters not displaying correctly after ... content Firefox would display invalid characters using? ... Inside the output file itself: ...
      (comp.lang.javascript)
    • [Review] Dungeon Twister - Forces of Darkness
      ... And any expansion for Dungeon Twister ... characters are simply tremendous, although they often have a flaw. ... Darkness spaces on the board, as if they were not there, and attack in ... Combat 2 -flying, undead). ...
      (rec.games.board)
    • Re: Titan Quest expansion / Immortal Throne
      ... The caravan can be found in most cities. ... A shared storage space that all characters can access, ... probably my favourite part of the expansion. ... i also made an alt diviner that i intend to be pure spellcaster. ...
      (comp.sys.ibm.pc.games.rpg)
    • Re: Probably very stupid script/bash question
      ... This type of redirection instructs the shell to read input from the ... No parameter expansion, command substitution, arithmetic expansion, or ... If any characters in word are ... lines in the here-document are not expanded. ...
      (Debian-User)
    • Re: Trouble reading fields containing special characters
      ... I double any possible single quote characters in the string. ... Any double single quotes in a string (all SQL strings are enclosed by single ...
      (microsoft.public.vb.database.ado)