Re: Bash script for files with spaces in the filenames

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

 



On 2/18/06, Eric Brunson <brunson@xxxxxxxxxxx> wrote:
> Here are a few comments on your buddy's script:
>
>     * in bash PWD is maintained by the shell, so you don't need to set
>       it with `pwd`
>     * you don't need to call "find $PWD", anyway, you can just do "find
>       .", since . *is* $PWD
>     * back ticks in shell scripts are so 1989, the preferred method
>       since 1994 is this:  $( some shell script )
>     * "for file in $( something big )" could blow out the max size of
>       the command line, which is usually around 4096 characters (I
>       think, but I never encounter it, since I code around it)
>
> Try this:
>
> #!/bin/bash
> find | while read file
> do
>  eyeD3 --force-update --set-encoding=utf8 "$file"
> done
>

Than you, I will keep those pointers in mind. Although I have by now
gotten past the filenames problem, I will most certainly use your
advice in the future as I will undoubtably need to learn to script in
bash.

 Dotan Cohen
http://technology-sleuth.com/question/why_are_internet_greeting_cards_dangerous.html
54


[Index of Archives]     [Current Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]     [Fedora Docs]

  Powered by Linux