Results 1 to 2 of 2
I'm working on a script that does a little explanation of things once executed.
I won't trouble with everything else, that's pretty much taken care of, but the main problem ...
- 11-09-2010 #1Just Joined!
- Join Date
- Nov 2010
- Posts
- 6
Format find output
I'm working on a script that does a little explanation of things once executed.
I won't trouble with everything else, that's pretty much taken care of, but the main problem is displaying the output of a find command in this manner:
However I've only managed to spit this out:This is an absolute path: /data/dir1/subdir1/testfile1
This is an absolute path: /data/dir1/subdir1/testfile10
This is an absolute path: /data/dir1/subdir1/testfile2
This is an absolute path: /data/dir1/subdir1/testfile3
This is an absolute path: /data/dir1/subdir1/testfile4
This is an absolute path: /data/dir1/subdir1/testfile5
This is an absolute path: /data/dir1/subdir1/testfile6
This is an absolute path: /data/dir1/subdir1/testfile7
This is an absolute path: /data/dir1/subdir1/testfile8
This is an absolute path: /data/dir1/subdir1/testfile9
For this part of the script, I've been using this.This is an absolute path: /data/dir1/subdir1/testfile1
testfile10
testfile2
testfile3
testfile4
testfile5
testfile6
testfile7
testfile8
testfile9
any idea on how to get "This an absolute path: " to appear at the beginning of every line?echo -e "This is an absolute path: \c"
find /data/dir1/subdir1/*
- 11-10-2010 #2Linux User
- Join Date
- Jan 2005
- Location
- Saint Paul, MN
- Posts
- 262
Look at piping the output of the "find" command into "sed" to change the begining of the line to the desired string. This is as close as I get to doing someone's homework assignment.


Reply With Quote