Simple Shell Programming Question: [ $( )]
I've been poking around Arch Linux's network scripts, and I can't seem to figure these lines out:
Code:
[ "$(/sbin/ifconfig ${1} 2>/dev/null | /bin/grep -v 'inet6 addr: fe80:' | /bin/grep -e 'inet addr:' -e 'inet6 addr')" ] && return 0 I know what everything does execpt $(/sbin/ifconfig ${1} 2>/dev/null) why is this in $() and that inside []? these parentheses with a dollar sign in front is confusing me. |
$(command) is same as the backtick symbol used in earlier versions .
for e.g instead of for file in `ls` I can do for file in $(ls) |
Thanks. Thats all I need to know.
|
All times are GMT -5. The time now is 07:46 AM. |