home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #16 / NN_1992_16.iso / spool / comp / unix / wizards / 3289 < prev    next >
Encoding:
Internet Message Format  |  1992-07-23  |  2.6 KB

  1. From: tmilner@hprpcd.rose.hp.com (Tom Milner)
  2. Date: Thu, 23 Jul 1992 00:05:50 GMT
  3. Subject: Re: A Shell Problem -- HELP HELP HELP!!!
  4. Message-ID: <15250001@hprpcd.rose.hp.com>
  5. Organization: Performance Technology Center, Roseville
  6. Path: sparky!uunet!haven.umd.edu!darwin.sura.net!mips!sdd.hp.com!hpscdc!hplextra!hpcc05!hpyhde4!hpycla!hpergfg2!hprdash!hprpcd!tmilner
  7. Newsgroups: comp.unix.wizards
  8. References: <1992Jul22.052116.5552@gucis.cit.gu.edu.au>
  9. Lines: 51
  10.  
  11. In comp.unix.wizards, dconnors@gucis.cit.gu.edu.au (David Connors) writes:
  12. |
  13. |
  14. |   HELP!
  15. |
  16. |   I have a bit of a problem which I can't solve as I don't know enough about
  17. |   using all of the thingamies (sed, awk etc) unix provides. Here's the problem:
  18. |
  19. |   I have a set of directories similar to the following:
  20. |
  21. |   rw-r--r--  0/0   1874 Mar 23 03:05 1991 logos/org/aero/unknown/face.xbm
  22. |   rw-r--r--  0/0   1871 Jun 18 04:01 1991 logos/org/eff/unknown/face.xbm
  23. |   rw-r--r--  0/0   1874 Jun  3 09:47 1991 logos/org/ieee/unknown/face.xbm
  24. |   rw-r--r--  0/0   1877 Jun  3 09:48 1991 logos/org/mitre/unknown/face.xbm
  25. |   rw-r--r--  0/0   1871 Feb 14 01:35 1991 logos/org/osf/unknown/face.xbm
  26. |
  27. |   .... about a thousand more lines ....
  28. |
  29. |   Now, what I want to do it move all of the "face.xbm" files to one directory 
  30. |   level while simultaneously giving them distinct filenames (I don't care
  31. |   what, although it would be nice if logos/org/osf/unknown/face.xbm became
  32. |   something like logos.org.osf.unknown.face.xbm).
  33. |
  34. |   If anyone can help I will be extremely grateful!
  35. |
  36. |   Please reply via e-mail as I don't read news that often.
  37. |
  38. |
  39. |
  40. |      Dave Connors - D.Connors@sct.gu.edu.au     Griffith University, Australia
  41. |    - -- ---=-==-=================================================-==--=--- -- -
  42. |         " Remember, even if you win the rat race, you're still a rat! "
  43. |                                      - Unknown
  44. |    - -- ---=-==-=================================================-==--=--- -- -
  45.  
  46. Try:
  47.  
  48.     find logos/org -name "face.xbm" | while read f; do
  49.         newf=`echo $f | sed "s/\//./g"`
  50.         mv $f $newf
  51.     done
  52.  
  53.                                   _____________________________________
  54.                                  /_______________  ___________________/
  55.                                                 / /
  56.                                                / /
  57.                                               / / Tom Milner (Tn: 785-5637)
  58.                                              / /  HP Performance Tech Center
  59.                                             / /   tom@hpptc16.rose.hp.com
  60.                                            /_/    __________________________
  61.                     
  62.