Re: Help with files and spaces with shell script

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> There were some interesting suggestions with setting IFS, but you can
> also do it like this (if there are no newlines in the file names):
>
> find /myth/recordings/ -maxdepth 1 -name \*.mpg -ctime -1 ! -mmin -1
> -print | while read i; do
> /usr/bin/mencoder "$i" -ovc xvid -oac mp3lame -xvidencopts bitrate=800
> -o $TMP/tmp.mpg > $TPM/enc_errors 2>&1 && cp -fv $TMP/tmp.mpg "$i"
> done
>
> No need to change IFS.
>
> --
> Sjoerd Mullender
>
Got to love Linux/BASH.  Always a few ways to so something, and each
one is a good one.  Some who seek the solution that involve the least
CPU time may have a preference.  But for most of us that is not an
issue.  As long as it works as expected, it's a good solution...

By the way I noted a typo in my suggestion.  In the beginning I use
ORIGINAL_IFS for my variable, but for the suggested last line of the
script I had IFS=$ORIGINAL.  That should have been IFS=$ORGINAL_IFS.

Jacques B.

-- 
fedora-list mailing list
fedora-list@xxxxxxxxxx
To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list
[Index of Archives]     [Older Fedora Users]     [Fedora Announce]     [Fedora Package Announce]     [EPEL Announce]     [Fedora Magazine]     [Fedora News]     [Fedora Summer Coding]     [Fedora Laptop]     [Fedora Cloud]     [Fedora Advisory Board]     [Fedora Education]     [Fedora Security]     [Fedora Scitech]     [Fedora Robotics]     [Fedora Maintainers]     [Fedora Infrastructure]     [Fedora Websites]     [Anaconda Devel]     [Fedora Devel Java]     [Fedora Legacy]     [Fedora Desktop]     [Fedora Fonts]     [ATA RAID]     [Fedora Marketing]     [Fedora Management Tools]     [Fedora Mentors]     [SSH]     [Fedora Package Review]     [Fedora R Devel]     [Fedora PHP Devel]     [Kickstart]     [Fedora Music]     [Fedora Packaging]     [Centos]     [Fedora SELinux]     [Fedora Legal]     [Fedora Kernel]     [Fedora OCaml]     [Coolkey]     [Virtualization Tools]     [ET Management Tools]     [Yum Users]     [Tux]     [Yosemite News]     [Gnome Users]     [KDE Users]     [Fedora Art]     [Fedora Docs]     [Asterisk PBX]     [Fedora Sparc]     [Fedora Universal Network Connector]     [Libvirt Users]     [Fedora ARM]

  Powered by Linux