is there is a command in bash that checks if a program can or cannot run -
is there is a command in bash that checks if a program can or cannot run -
i origin larn how create bash scripts.
i want know if there way test if programme can run or not. example, want test if ncl runs.
if write ncl
on terminal
xxx$ ncl dyld: library not loaded: /usr/local/lib/libgomp.1.dylib referenced from: /usr/local/ncl-6.2.1/bin/ncl reason: image not found trace/bpt trap: 5
that means ncl
installed, programme cannot run due lack of library.
i want know if there command in bash gives me 1 or 0 depending if ncl
(or other program) runs or doesn't run.
you should able check homecoming value of command in bash this...
somecommand argument1 argument2 retval=$? [ $retval -eq 0 ] && echo success [ $retval -ne 0 ] && echo failure
bash
Comments
Post a Comment