From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fee84,9a9e0ff71b5fce17 X-Google-Attributes: gidfee84,public From: kluge@ave.ac.agit.de (Steffen Kluge) Subject: Re: tr problem? Date: 1996/07/11 Message-ID: <4s2gt4$4cs@csl2.csl-gmbh.net>#1/1 X-Deja-AN: 167766773 references: <4rvc34$n6l@fang.dsto.defence.gov.au> organization: ave Verkehrs- und Informationstechnik GmbH newsgroups: comp.unix.osf.osf1 In article <4rvc34$n6l@fang.dsto.defence.gov.au>, Greg Robinson wrote: >hi, > >Can anyone make tr work with the following input? > >./qfKAA12670 >./qfKAA14036 >./qfJAA06816 >./qfKAA14029 >./qfJAA08041 >./qfKAA13145 > >I want to replace the qf with ?? so it removes the header file, body file >and status file. ie. qf, df and xf files... > >I am using the tr line thus: > >tr -s 'a-z' '[??*]' < filename > >This doesnt NOT work! > >BUT, if the file is: > >./dfKAA12670 >./dfKAA14036 >./dfJAA06816 >./dfKAA14029 >./dfJAA08041 >./dfKAA13145 > >It does work! > >It's for clearing out a mail from the mail spool after a storm... *sigh* >[...] I'm not sure if I understand you problem well, in case you just want to delete the files just do $ rm /var/spool/[qdx]f* If you really want to rename them you could use the string substitution capabilities of you shell (if it is powerful enough). For example, using ksh: $ for f in /var/spool/[qdx]f*; do > mv $f '??'${f#??} > done $ Hope this helps Steffen. -- Steffen Kluge ave GmbH Aachen Keywords: photography, Mozart, UNIX, Islay Malt --