Re: ~/.bashrc problem
From: Olive (olive.lin_at_versateladsl.be)
Date: 04/15/05
- Previous message: Dave Ewart: "Re: Re: APT-GET UPGRADE VS DIST-UPGRADE"
- In reply to: Kuang He: "Re: ~/.bashrc problem"
- Next in thread: Kuang He: "Re: ~/.bashrc problem"
- Reply: Kuang He: "Re: ~/.bashrc problem"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
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
- Previous message: Dave Ewart: "Re: Re: APT-GET UPGRADE VS DIST-UPGRADE"
- In reply to: Kuang He: "Re: ~/.bashrc problem"
- Next in thread: Kuang He: "Re: ~/.bashrc problem"
- Reply: Kuang He: "Re: ~/.bashrc problem"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|