Thanks Sandip,
> find dir/ -exec dos2unix {} \;
I tried this but the code would not respond. Maybe
dos2unix not getting arguments. Is it ?
So, heres final alias I made.
for fileName in `find $1 -follow -type f`; do echo
"Processing $fileName; cat $fileName | tr -d '\015' >
$fileName done;
Will do everything I need !!
a) Can be aliased.
b) Recursive.
c) Checks only files (not directories)
d) No temp files.
Additionally
e) follows links.
f) Uses no dos2unix program.
One questions though : How does input is passed from
one side of the pipe to the other if the commands are
executing in two different shells ?
Cheers,
Amol.
--- Sandip Bhattacharya <[EMAIL PROTECTED]> wrote:
> At 11:35 PM 7/31/2002 -0700, you wrote:
> >--- Sandip Bhattacharya <[EMAIL PROTECTED]>
> wrote:
> > > a) for x in dir/*; do dos2unix $x ; done
> > > (Instead of dos2unix you can use your own
> > > commandline as yo had done
> > > before)
> >
> >Cool, but does not recurse through subdirectories !
>
> find dir/ -exec dos2unix {} \;
>
> > >
> > > No. This is because the shell creates a
> different
> > > parallel process for
> > > every command in the pipes of the command-line.
> > > Since they have all been
> > > spawned from the shell at the same time, a
> variable
> > > in environment of one
> > > of the process is not available in a parallel
> > > process.
> > >
> >
> >Do I have four bash programs in memory there ?
>
> Yes. Four spawned(fork+exec) programs in memory.
>
> - Sandip
>
>
> ================================================
> To unsubscribe, send email to [EMAIL PROTECTED]
> with unsubscribe in subject header. Check archives
> at http://www.mail-archive.com/ilugd%40wpaa.org
>
__________________________________________________
Do You Yahoo!?
Yahoo! Health - Feel better, live better
http://health.yahoo.com
================================================
To unsubscribe, send email to [EMAIL PROTECTED] with unsubscribe in subject
header. Check archives at http://www.mail-archive.com/ilugd%40wpaa.org