home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #18 / NN_1992_18.iso / spool / comp / unix / question / 10258 < prev    next >
Encoding:
Internet Message Format  |  1992-08-21  |  618 b 

  1. From: srini@hpcuhe.cup.hp.com (Sreenivasa R Tellakula[C])
  2. Date: Thu, 20 Aug 1992 23:34:31 GMT
  3. Subject: Re: Changing file names
  4. Message-ID: <31810002@hpcuhe.cup.hp.com>
  5. Organization: Hewlett Packard, Cupertino
  6. Path: sparky!uunet!usc!sdd.hp.com!hpscdc!hplextra!hpcc05!hpcuhb!hpcuhe!srini
  7. Newsgroups: comp.unix.questions
  8. References: <ac#n06l.bosak@netcom.com>
  9. Lines: 19
  10.  
  11.  
  12. following script should be able to change file names
  13.  
  14.  
  15. #!/bin/ksh
  16. for i in `ls`
  17. do
  18.   echo $i | sed s/xyz// >j
  19.   mv $i `cat j`
  20. done
  21. rm j
  22. #end script
  23. #assumption is that the file by name j is not
  24. #existing in the directory
  25.  
  26.  
  27.  
  28. -- TSR
  29.     srini@cup.hp.com
  30.