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

class="lang-none prettyprint-override">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

Popular posts from this blog

formatting - SAS SQL Datepart function returning odd values -

c++ - Apple Mach-O Linker Error(Duplicate Symbols For Architecture armv7) -

php - Yii 2: Unable to find a class into the extension 'yii2-admin' -