만약 ethernet interface가 eth0 인 경우
1 2 3 $ IPADDR=$(ifconfig eth0|grep inet|head -1|sed 's/\:/ /'|awk '{print $2}') $ echo $IPADDR 172.17.0.3
1 2 3
$ IPADDR=$(ifconfig eth0|grep inet|head -1|sed 's/\:/ /'|awk '{print $2}') $ echo $IPADDR 172.17.0.3
Directory Exists? $ cat directory_ex.sh #!/bin/bash test_dir_exist(){ set -e if [ -e "/home/jayleekr/workspace/00_codes/05_info_archive" ];then echo "DIR Exist" exit 1 ...
And $ cat and_or.sh #!/bin/bash test_and_or(){ TEST="11" TEST2="22" if [ "$TEST" == "11" ] && [ "$TEST2" == "22" ] ;then echo "String Exist by And" fi if [ "$...
for $ cat for.sh #!/bin/bash LISTS=("a" "b" "c") # Don't forget Brace! echo ${LISTS[0]} echo ${LISTS[1]} echo ${LISTS[2]} # Don't forget Brace! for item in ${LISTS[@]} do echo $item done $...
Bash eval utility?
Bash sed?
Comments powered by Disqus.