在这个语句中我试图匹配路径/ app/$ var1(应用程序名称)中是否存在版本($ var2)
if
find /app/$var1 -maxdepth 1 -type l -o -type d | grep $var2 #results in a nice list where i can manually get a true match.
# if match is found then execute command.
$realcmd "$@"
rc=$?
exit $rc
else
echo "no match, the version you are looking for does not exist"
fi
Run Code Online (Sandbox Code Playgroud)
当前代码:这包括我的所有代码(未清除).命令我运行:"./ xmodule load firefox/3.6.12"此版本确实退出
#!/bin/bash
# hook for some commands
#echo $@ #value of sting that is entered after "xmodule"
cmd=$(basename "$0")
#echo …Run Code Online (Sandbox Code Playgroud)