* Re: Help: deleting directories with !2 in name
1995-11-30 5:00 Help: deleting directories with !2 in name Joyce Cooper (EPCD)
@ 1995-11-30 5:00 ` Philip A. Schueller
1995-12-01 5:00 ` Harald Fuchs
` (3 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: Philip A. Schueller @ 1995-11-30 5:00 UTC (permalink / raw)
In article <Pine.SOL.3.91.951130153702.25664A-100000@info.census.gov>,
"Joyce Cooper (EPCD)" <joycec@Census.GOV> wrote:
> If I try going into these directories
> to remove the files 'cd os!2_sys' e.g., I get the error message "2: event
> not found".
>
> Any suggestions?
>
Whenever referring to an object that contains an exclaimation point, try
quoting the symbol with a backslash. I.e., try:
cd os\!2_sys
Same goes for rm and rmdir. This quoting inhibits the shell from
interpreting the exclaimation point as a history event.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Help: deleting directories with !2 in name
@ 1995-11-30 5:00 Joyce Cooper (EPCD)
1995-11-30 5:00 ` Philip A. Schueller
` (4 more replies)
0 siblings, 5 replies; 6+ messages in thread
From: Joyce Cooper (EPCD) @ 1995-11-30 5:00 UTC (permalink / raw)
When extracting from a tar file archive of an OS/2
operating system on the OSF/1 Alpha, the OS/2 desktop directory
containing two files
with !2 in their file names was placed in the root directory.
OSF/1 doesn't let me remove these . If I try rm *, I get the response
that these are directories. If I try rmdir * I get the response that
these directories contain files. If I try going into these directories
to remove the files 'cd os!2_sys' e.g., I get the error message "2: event
not found".
Any suggestions?
Thanks.
j.c.
****************************************************************
Joyce M. R. Cooper
U.S. Census Bureau
Boston Research Data Center E-Mail joycec@info.census.gov
****************************************************************
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Help: deleting directories with !2 in name
1995-11-30 5:00 Help: deleting directories with !2 in name Joyce Cooper (EPCD)
1995-11-30 5:00 ` Philip A. Schueller
1995-12-01 5:00 ` Harald Fuchs
@ 1995-12-01 5:00 ` Pekka Niemi
1995-12-03 5:00 ` Pekka Niemi
1995-12-12 5:00 ` Joyce Cooper (EPCD)
4 siblings, 0 replies; 6+ messages in thread
From: Pekka Niemi @ 1995-12-01 5:00 UTC (permalink / raw)
>>>>> "Joyce" == EPCD <Joyce> writes:
Joyce> OSF/1 doesn't let me remove these . If I try rm *, I get
Joyce> the response that these are directories. If I try rmdir *
Joyce> I get the response that these directories contain files.
Joyce> If I try going into these directories to remove the files
Joyce> 'cd os!2_sys' e.g., I get the error message "2: event not
Joyce> found".
Isn't there a FAQ for deleting files with special characters in their names?
The point is to 'escape' the exclamation mark, which has a special
meaning at least in csh and bash. Escaping is done by inserting a backslash in
front of the character (like \!). You can also prevent the shell from
interpreting the string by surrounding it with single quotes ('os!2_sys').
- After removing those unwanted directories you may see it appropriate to
re-consult the manual page for the command interpreter you are using.
Cheers,
pen
--
Pekka Niemi
Unix system administrator @ Comptel
Tel. +358-0-7001 1613
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Help: deleting directories with !2 in name
1995-11-30 5:00 Help: deleting directories with !2 in name Joyce Cooper (EPCD)
1995-11-30 5:00 ` Philip A. Schueller
@ 1995-12-01 5:00 ` Harald Fuchs
1995-12-01 5:00 ` Pekka Niemi
` (2 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: Harald Fuchs @ 1995-12-01 5:00 UTC (permalink / raw)
pen@comptel.fi (Pekka Niemi) writes:
> The point is to 'escape' the exclamation mark, which has a special
> meaning at least in csh and bash. Escaping is done by inserting a
> backslash in front of the character (like \!).
Correct so far.
> You can also prevent the shell from
> interpreting the string by surrounding it with single quotes ('os!2_sys').
No; history substitution has a higher priority than single or double
quotes in all shells I'm aware of.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Help: deleting directories with !2 in name
1995-11-30 5:00 Help: deleting directories with !2 in name Joyce Cooper (EPCD)
` (2 preceding siblings ...)
1995-12-01 5:00 ` Pekka Niemi
@ 1995-12-03 5:00 ` Pekka Niemi
1995-12-12 5:00 ` Joyce Cooper (EPCD)
4 siblings, 0 replies; 6+ messages in thread
From: Pekka Niemi @ 1995-12-03 5:00 UTC (permalink / raw)
>> You can also prevent the shell from interpreting the string by
>> surrounding it with single quotes ('os!2_sys').
Harald> No; history substitution has a higher priority than single
Harald> or double quotes in all shells I'm aware of.
Humm, depends on the shell - with csh that is true, while bash handles
it differently:
sohvi-19:39:45> touch \!
sohvi-19:39:55> ls -l '!'
-rw-r--r-- 1 pen comptel 0 Dec 3 19:39 !
sohvi-19:40:00>
Though the poster didn't tell which shell was in use, and silly me didn't
consider the csh 8-(
pen
--
Pekka Niemi
Unix system administrator @ Comptel
Tel. +358-0-7001 1613
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Help: deleting directories with !2 in name
1995-11-30 5:00 Help: deleting directories with !2 in name Joyce Cooper (EPCD)
` (3 preceding siblings ...)
1995-12-03 5:00 ` Pekka Niemi
@ 1995-12-12 5:00 ` Joyce Cooper (EPCD)
4 siblings, 0 replies; 6+ messages in thread
From: Joyce Cooper (EPCD) @ 1995-12-12 5:00 UTC (permalink / raw)
****************************************************************
On 3 Dec 1995, Pekka Niemi wrote:
> >> You can also prevent the shell from interpreting the string by
> >> surrounding it with single quotes ('os!2_sys').
>
> Harald> No; history substitution has a higher priority than single
> Harald> or double quotes in all shells I'm aware of.
>
> Humm, depends on the shell - with csh that is true, while bash handles
> it differently:
>
> sohvi-19:39:45> touch \!
> sohvi-19:39:55> ls -l '!'
> -rw-r--r-- 1 pen comptel 0 Dec 3 19:39 !
> sohvi-19:40:00>
>
> Though the poster didn't tell which shell was in use, and silly me didn't
> consider the csh 8-(
>
> pen
> --
> Pekka Niemi
> Unix system administrator @ Comptel
> Tel. +358-0-7001 1613
>
>
the shell is csh.
j.c.
______________________________
Joyce Cooper
U.S. Census Bureau
Boston Research Data Center e-mail: joycec@info.census.gov
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~1995-12-12 5:00 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
1995-11-30 5:00 Help: deleting directories with !2 in name Joyce Cooper (EPCD)
1995-11-30 5:00 ` Philip A. Schueller
1995-12-01 5:00 ` Harald Fuchs
1995-12-01 5:00 ` Pekka Niemi
1995-12-03 5:00 ` Pekka Niemi
1995-12-12 5:00 ` Joyce Cooper (EPCD)
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox