Vale Kenny on Wed, 19 Jan 2000 12:13:06 -0500 (EST)


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

[PLUG] escaping on teh commandline..


ok, I realize that this is probably old hat to most of you, but it'll probably
save quite a bit of hassle for some.

I accidentally named a file " \ "  when saving in vi
now as we learned yesterday, the " \ " character is a line continuation in most
shells (all shells?), so if you do a 
cp \ blah
you'll get a 
>
awaiting more input, or conversely, if you do a 
rm \
you'll get the same 
>
prompt..
so I looked at it for a few seconds, and I *felt* the blocks click into place in
the old brain.. you have to _escape_ it first.  in C, a \ is an escape to a
format command hence the " \n " for a newline.  to actually print a \ in a
string of text, you have to place a double backslash " \\ "
so, to remove or rename a file named " \ " you would enter
mv ./\\ blah

again, this is probably old hat to most of you, but the key for me was the
discovery itself...it was really cool to feel the connections being made in my
head.. I just sat back for two seconds, and click, clickclick, *pop* out came
the answer..
<Grin> Peace,
Vale

______________________________________________________________________
Philadelphia Linux Users Group       -       http://plug.nothinbut.net
Announcements - http://lists.nothinbut.net/mail/listinfo/plug-announce
General Discussion   -   http://lists.nothinbut.net/mail/listinfo/plug