home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #30 / NN_1992_30.iso / spool / comp / unix / shell / 5047 < prev    next >
Encoding:
Internet Message Format  |  1992-12-13  |  866 b 

  1. Path: sparky!uunet!pipex!warwick!uknet!almac!tony.dunning
  2. From: tony.dunning@almac.co.uk (Tony Dunning)
  3. Newsgroups: comp.unix.shell
  4. Subject: script for changing file
  5. Message-ID: <939.835.uupcb@almac.co.uk>
  6. Date: 14 Dec 92 02:21:00 GMT
  7. Reply-To: tony.dunning@almac.co.uk (Tony Dunning)
  8. Organization: Almac BBS Ltd. Scotland. +44 (0)324-665371
  9. Lines: 24
  10.  
  11. TO: newman@cptc1.neep.wisc.edu
  12.  
  13. DN>For example if the directory contained OUT1 OUT2 OUT3 and TEXT
  14. DN>I could run the script rename OUT run1 and have it return
  15. DN>OUT1run1 OUT2run1 OUT3run1 TEXT.
  16.  
  17. Try the following
  18.  
  19. script name eg scr1  , containing the following
  20.  
  21. find . -name "*$1*" -exec scr1sub {} \;
  22.  
  23. where scr1sub would read :
  24.  
  25. mv $1 $1$2
  26.  
  27. This would find all files in your directory & down from your directory
  28.  
  29.  
  30.  
  31.         Tonyd
  32. ---
  33.  . OLX 2.2 . Unable to locate Coffee -- Operator Halted!
  34.                   
  35.