OS evaluate in bash script

Posted by moata_u on Ask Ubuntu See other posts from Ask Ubuntu or by moata_u
Published on 2011-03-11T08:28:23Z Indexed on 2011/03/11 16:19 UTC
Read the original article Hit count: 392

Filed under:
|

i was thinking in way that before run my script , evaluate which operating system that user use ubuntu or solaris , am using this because there is some differences
in command option in each OS such as sed .. , i was trying the following :

sysEval=`grep "ubuntu" | uname -a`

if [ sysEval ]; then

.......some command 

else ....... some command
fi

NOTE That my script will run only in ubuntu or solaris
seems not working !

© Ask Ubuntu or respective owner

Related posts about bash

Related posts about commands