On Wednesday 26 January 2005 14:11, Jeremy C. Reed wrote:
> No escape in that example. The . (dot) simply means current directory, so
> copy X to the file named "-X" in the current directory.
Why didn't it give me the 'invalid option' error?
> Of the above mentioned only cp X ./-X worked. Why is that? Is that how the
> escape character works; only with the period? I am confused!
Or is it because if you give it an absolute location it writes it as-is?
Let's experiment: [1]
Interesting: It works for some but not others.Perhaps that is why there are
multiple ways of doing it.
Whatever.
[1]
plaything@1[experementation]$ ls
andor answers jh pens stationary tape -X
andor~ answers.0197 memo sample.txt supply.order X
plaything@1[experementation]$ touch hey
plaything@1[experementation]$ cp hey ./hey
cp: `hey' and `./hey' are the same file
plaything@1[experementation]$ cp hey ./&hey
[1] 4027
cp: `hey' and `./hey' are the same file
bash: hey: command not found
[1]+ Exit 1 cp hey ./
plaything@1[experementation]$ cp hey ./$hey
cp: `hey' and `./hey' are the same file
plaything@1[experementation]$ cp hey ./:hey
plaything@1[experementation]$ cp hey ./~hey
plaything@1[experementation]$ cp hey ./!hey
bash: !hey: event not found
plaything@1[experementation]$ cp hey ./%hey
plaything@1[experementation]$ cp hey ./\hey
cp: `hey' and `./hey' are the same file
plaything@1[experementation]$ cp hey .//hey
cp: `hey' and `.//hey' are the same file
plaything@1[experementation]$ cp hey ./#hey
plaything@1[experementation]$ cp hey ./^hey
plaything@1[experementation]$ cp hey ./}hey
plaything@1[experementation]$ cp hey ./{hey
plaything@1[experementation]$ cp hey ./>hey
cp: `hey' and `./hey' are the same file
plaything@1[experementation]$ cp hey ./<hey
cp: `hey' and `./hey' are the same file
plaything@1[experementation]$ cp hey ./)hey
bash: syntax error near unexpected token `)'
plaything@1[experementation]$ cp hey ./(hey
bash: syntax error near unexpected token `('
plaything@1[experementation]$ cp hey ./]hey
plaything@1[experementation]$ cp hey ./`hey
>
plaything@1[experementation]$ cp hey ./"hey
>
plaything@1[experementation]$ cp hey ./'hey
>
plaything@1[experementation]$ cp hey ./?hey
cp: copying multiple files, but last argument `./%hey' is not a directory
Try `cp --help' for more information.
plaything@1[experementation]$ cp hey ./*hey
cp: copying multiple files, but last argument `./%hey' is not a directory
Try `cp --help' for more information.
plaything@1[experementation]$ cp hey ./|hey
cp: `hey' and `./hey' are the same file
bash: hey: command not found
plaything@1[experementation]$ cp hey ./;hey
cp: `hey' and `./hey' are the same file
bash: hey: command not found
plaything@1[experementation]$ cp hey ./&hey
cp: `hey' and `./hey' are the same file
[1] 5210
bash: hey: command not found
[1] Exit 1 cp hey ./
plaything@1[experementation]$
plaything@1[experementation]$ ls
andor answers.0197 ~hey {hey %hey pens supply.order -X
andor~ hey :hey }hey jh sample.txt tape
answers ^hey ]hey #hey memo stationary X
plaything@1[experementation]$
---------------------------------------------------
PLUG-discuss mailing list -
PLUG-discuss@lists.plug.phoenix.az.us
To subscribe, unsubscribe, or to change you mail settings:
http://lists.PLUG.phoenix.az.us/mailman/listinfo/plug-discuss