我有两个变量 $a 和 $b
是否有 shell 脚本命令将最小变量的值分配给 $c
IE
$c = min($a,$b)
Run Code Online (Sandbox Code Playgroud)
以及一些可以在所有平台上运行的命令 hp-ux,aix,linux_x_64
提前致谢
编辑:默认外壳是 ksh
在我试图运行的脚本下方
rm abc.log
near_dr=`sqlplus -s tcs384160/tcs#1234 <<\EOF
set pagesize 0 feedback off verify off heading off echo off
select max(sequence#) from v$archived_log where applied='YES' and thread#=1 and
dest_id=2;
exit;
EOF`
DR=`sqlplus -s tcs384160/tcs#1234 <<\EOF
set pagesize 0 feedback off verify off heading off echo off
select max(sequence#) from v$archived_log where applied='YES' and thread#=1 and
dest_id=3;
exit;
EOF`
safe_var=$([ $near_dr -le $DR ] && …Run Code Online (Sandbox Code Playgroud)