ICT: Diary
D: 28 W: 05

< October 2022 >
Sun Mon Tue Wed Thu Fri Sat
 1
2345678
9101112131415
16171819202122
23242526272829
3031 

Based on notaweblog.php by joshua stein

[ ] Wednesday, 12 October 2022 [ ]

Shell Scripting

In shell scripting the checking a string is achieved using [ ${var} = "string" ], if you are writing bash scripts you can use == for the equality test, but this is a non standard extension.

os=`uname` if [ ${os} = "Linux" ]; then path=/usr/bin/ else path=/usr/local/bin/ fi

Is an example of an if statement using this test.

equalityshell


$Id: diary,v 1.38 2025/01/01 22:43:54 fred Exp $