On 12 Jan 2012 at 14:02:50, Dean S. Messing wrote:
> 
> In a system script I find this snippet
> 
>   nodevs=$(< /proc/filesystems fgrep rootfs)
> 
> and don't understand the syntax.  According to the bash man page,
> 
> $(< file) is shorthand for $(cat file).  But then the above should read
> 
>   nodevs=$(< /proc/filesystems | fgrep rootfs)
> 
> However, the latter leaves $nodevs empty whereas the former puts the
> stuff that fgrep processes into nodevs as it should.


The command 
 < /proc/filesystems fgrep rootfs

redirects the input from the file /proc/filesystems into the command
"fgrep rootfs". You could rewrite this as
  fgrep rootfs < /proc/filesystems

nodevs=$( command ) takes the result of the command inside the
parentheses and assigns into the variable nodevs.

                        Anthony.

-- 
users mailing list
users@lists.fedoraproject.org
To unsubscribe or change subscription options:
https://admin.fedoraproject.org/mailman/listinfo/users
Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines
Have a question? Ask away: http://ask.fedoraproject.org

Reply via email to