Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
Well the command does not run like that on my system. It had to change it to:
print "+---$dir" `ls -l $dir |sed 's/^.*"$dir" //'`
I don't know what it is supposed to do though, since "ls -l" does not show the hidden files anyway that sed 's/^.* is trying to remove. That's my take on it. It does run, but the output does not look like anything i'd want to use.
-jim

If you post the rest of the script, you will see that it is part of some code that first performs a test to determine if a directory is a link. It is part of a script that prints a directory tree. If the test is true, the sed will get rid of everything but the directory name. Thus, in this particular script, if there is a directory named junk in the /tmp directory that is a link to /home/jlemieux, only the name jlemieux will be printed. It causes the output to look like this:
Initial directory = /tmp
+---bos
| +---oldvgs
+---junk -> /home/jlemieux
+---vgdata
| +---rootvg
Total directories = 4Remove the sed and the output looks like this:
Initial directory = /tmp
+---bos
| +---oldvgs
+---junk lrwxrwxrwx 1 root user 14 Sep 23 01:20 junk -> /home/jlemieux
+---vgdata
| +---rootvg
Total directories = 4Not what is wanted in this case.
Jerry Lemieux

![]() |
![]() |
![]() |

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.
| Ads by Google |