Help! trouble with "rm" T "rm"

Help! trouble with "rm" T "rm"

Post by Brian Mansfie » Sat, 12 Mar 1994 13:04:33



Please help!  I am having trouble deleting files from
my home directory.  In the first case when I type:  

        rm Anderson-School-Telephone-Directory-(Text)

 the system replies "syntax error".
 )

In the second instance when I type:

        rm FINDING-EMAIL-ADDRESSES.;2

 the system replies "no such file or directory".  In both cases above
 I also tried to rename the files using mv but again had no success.  I
 would be grateful if anyone can help with this mess!

Thanks,

Brian

 
 
 

Help! trouble with "rm" T "rm"

Post by jun sh » Sat, 12 Mar 1994 23:51:12



>Please help!  I am having trouble deleting files from
>my home directory.  In the first case when I type:  

>        rm Anderson-School-Telephone-Directory-(Text)

> the system replies "syntax error".
> )

>In the second instance when I type:
>        rm FINDING-EMAIL-ADDRESSES.;2
> the system replies "no such file or directory".  In both cases above
> I also tried to rename the files using mv but again had no success.  I
> would be grateful if anyone can help with this mess!
>Thanks,
>Brian


use "\" to escape those special char if using csh.  that is

rm Anderson-School-Telephone-Directory-\(Text\)
rm FINDING-EMAIL-ADDRESSES.\;2

--

---


 
 
 

Help! trouble with "rm" T "rm"

Post by Ray Jon » Sun, 13 Mar 1994 02:31:04



:>Please help!  I am having trouble deleting files from
:>my home directory.  In the first case when I type:  
:>        
:>        rm Anderson-School-Telephone-Directory-(Text)
:>
:> the system replies "syntax error".
:> )
:>                                                    
:>In the second instance when I type:

:>        rm FINDING-EMAIL-ADDRESSES.;2

:> the system replies "no such file or directory".  In both cases above
:> I also tried to rename the files using mv but again had no success.  I
:> would be grateful if anyone can help with this mess!

In both cases you have "magic" characters in the file names.  The shell sees
these characters, not a part of the file name but tries to do some shell
"magic" with them.
        rm Anderson-School-Telephone-Directory-(Text)
                                               ^and ^= magic characters
        the ( and ) are for grouping commands
        rm FINDING-EMAIL-ADDRESSES.;2
                                   ^=magic character
The shell sees this as 2 different commands, I.e., ; same as [RETURN].
rm FINDING-EMAIL-ADDRESSES.
2
There is no file named  "FINDING-EMAIL-ADDRESSES."
and no command "2"
You have to hide these magic characters from the shell with either

        rm 'Anderson-School-Telephone-Directory-(Text)'
        rm 'FINDING-EMAIL-ADDRESSES.;2 '
or
        rm Anderson-School-Telephone-Directory-\(Text\)
        rm FINDING-EMAIL-ADDRESSES.\;2
--

Ray A. Jones; Celestial Software       | spelling errors in this missive
8545 S.E. 68th Street                  | approaches unity. If this bothers you,
Mercer Island, WA 98040;(206) 236-1676 | run it through your spell checker!

 
 
 

Help! trouble with "rm" T "rm"

Post by Darcy Semeni » Sun, 13 Mar 1994 05:34:59


: Please help!  I am having trouble deleting files from
: my home directory.  In the first case when I type:  
:          
:         rm Anderson-School-Telephone-Directory-(Text)
:  
:  the system replies "syntax error".
:  )
:                                                    

Try rm Anderson-School-Telephone-Directory-\(Text\)

: In the second instance when I type:

:         rm FINDING-EMAIL-ADDRESSES.;2

Try rm  FINDING-EMAIL-ADDRESSES.\;2

:  the system replies "no such file or directory".  In both cases above
:  I also tried to rename the files using mv but again had no success.  I
:  would be grateful if anyone can help with this mess!

The shell has special characters that include ( and ;.  To use these
as literals, you have to excape them with \

Darcy

 
 
 

Help! trouble with "rm" T "rm"

Post by Ashish Gula » Tue, 15 Mar 1994 07:52:22



>Please help!  I am having trouble deleting files from
>my home directory.  In the first case when I type:  

>        rm Anderson-School-Telephone-Directory-(Text)

> the system replies "syntax error".
> )

>In the second instance when I type:
>        rm FINDING-EMAIL-ADDRESSES.;2
> the system replies "no such file or directory".  In both cases above
> I also tried to rename the files using mv but again had no success.  I
> would be grateful if anyone can help with this mess!
>Thanks,
>Brian


Try the following

a) rm Anderson-School-Telephone-Directory-\(Text\)
b) rm FINDING-EMAIL-ADDRESSES.\;2

Hope it works for you.

Ashish Gulati