Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!pacific.mps.ohio-state.edu!linac!att!att!cbnewsl!urban From: urban@cbnewsl.att.com (john.urban) Newsgroups: comp.unix.questions Subject: Re: Problems with rm -f Summary: csh -> No match Message-ID: <1991May15.125427.2241@cbnewsl.att.com> Date: 15 May 91 12:54:27 GMT References: <1991May14.190816.17169@rodan.acs.syr.edu> Distribution: usa Organization: AT&T Bell Laboratories Lines: 46 In article <1991May14.190816.17169@rodan.acs.syr.edu> jstewart@rodan.acs.syr.edu (Ace Stewart) writes: > >System: Sun 4/490 running 4.1_PSR_A > >Problem: When running a "rm -f" on files that may or may not be in a >sub-directory, the -f doesn't seem to suppress the error output if a >file doesn't exist. Script as follows: > >---------------- >% ls .Mail/drafts Listing of directory >1 2 >3 ,1 >,4 > >% rm -f .Mail/drafts/,* Remove the , files (temp files) >% All okay! :) > >% rm -f .Mail/drafts/,* Do it again, _problems!_ >No match. >% >---------------- > >What the heck is the -f option there for if it still throws up at you >if files in a sub-directory don't exist? It works fine if you are _in_ >a that directory (i.e. 'rm -f ,*' run twice in the sub-directory >suppresses errors correctly) > >Comments/suggestions/help? Am I doing something incredibly stupid? The 'No match' comes from the csh(1) and not from rm(1). Try: % ls -l .Mail/drafts/,* No match. % If you change your shell to the bourne shell (sh) or the korn shell (ksh), $ ls -l .Mail/drafts/,* will show: .Mail/drafts/,*: No such file or directory $ The rm command is working fine it is the C Shell that is displaying the No match before rm 'sees' the arguments. Sincerely, John Ben Urban