Quote:
Originally posted by eallen
Why is the following happening?
mis254@mis254:~> JUNK="/home/mis254/r?belcher"
mis254@mis254:~> echo $JUNK
/home/mis254/r belcher
mis254@mis254:~> JUNK="/home/mis254/r?belchers"
mis254@mis254:~> echo $JUNK
/home/mis254/r?belchers
The first case JUNK is a path to a real file on my system called...
/home/mis254/r belcher
when I echo out JUNK, it will not echo the '?' character
The second case JUNK is not a path to a real file.
when I echo out JUNK this time, it will echo the '?' character.
It appears the echo command is determining my string of chars to
be an actual file. Is this normal?
|
Not sure what shell/echo you are using,
but in bash it's *not* normal, and it doesn't work that
way, either ;) ... Since anything you put in $JUNK
is just a string of characters it shouldn't (and in
GNU bash, version 2.05a.0(1) doesn't) matter whether
it happens to be a file's name or not :)
Must be a peculiarity of whatever shell/echo
you are using ;)
Cheers,
Tink