Re: Start a daemon, show a syntax error

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



On 2012-02-17 at 12:03 +0100, Lukas Fleischer wrote:
> "done < $(foo)" isn't the same thing as "done < <(foo)".

Just out of curiosity: in unmount_all() in /etc/rc.d/functions
this is used:

    while read -r target fstype options; do
        ...
    done < <(findmnt -mrunRo TARGET,FSTYPE,OPTIONS /)

But why not simply use a pipe in this case:

    findmnt -mrunRo TARGET,FSTYPE,OPTIONS / \
            | while read -r target fstype options; do
        ...
    done

This should do the same and would be more idiomatic.  The commit
message[1] when this was introduced did not say anything about
that.

I wonder what might be the reason for this, understand it and
thus improve my shell scripting skills. :)

Thanks,
Sebastian

[1]: http://projects.archlinux.org/initscripts.git/commit/?id=34714bf34e5928479e5ec4367e5e79902876dfa3


[Index of Archives]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]
  Powered by Linux