Re: OT: Bash Scripting Question
On Sunday 10 April 2005 11:29 pm, Steve Lamb wrote:
> Hal Vaughan wrote:
> > But if you do a ls -R, it won't give you the pathnames for the files in
> > subdirectories.
>
> Wrong. I'll leave it as an exercise to the reader to figure out what
> ls -R does and how it does it. Consider it a good hint to always run the
> command(s) in question before stating what they don't do. ;)
I did run it. It didn't give the output I've been talking about since the
start of the thread. I think we've got a misunderstanding because I didn't
specify, in that post, that by full pathname, I meant with the filename.
If you use ls -1r, it will give you pathnames, but on separate lines. It
won't give you a listing like this:
cd /home/foo
ls -R --some-magic-switch
Output:
/home/foo/Desktop
/home/foo/Destop/Home.desktop
/home/foo/Documents
/home/foo/Documents/MyProg.pl
/home/foo/Documents/BrilliantNovel.sxw
Which was the original question, and one of the main points that started the
discussion.
So, yes, I ran it. No, it didn't give the type of output that had been in
discussion since my original question. Yes, it does give pathnames. No,
they're not in usable form if you're writing a script -- unless you want to
add a bunch more stuff. (If you want to prove me wrong and post a script
that does this and easily gives the full path for each file using this,
please do -- I'm sure I'm not the only one who might use it instead of the
find command as discussed.)
Hal
>
> --
> Steve C. Lamb | I'm your priest, I'm your shrink, I'm your
> PGP Key: 8B6E99C5 | main connection to the switchboard of
> souls.
> -------------------------------+-------------------------------------------
>--
Reply to: