-1
有一個小bash腳本如下有沒有什麼辦法來顯示,如果火柴盒
#!/bin/bash
C="Subsystem sftp /usr/libexec/openssh/sftp-server #### #### "
if [ "$D(`grep Subsystem /etc/ssh/sshd_config`)" == "$C" ]
then
echo "Entry is proper in sshd_config file"
else
echo " Entry present in conf file $D "
echo ""
echo -e "it should be \t\t\t$C "
fi
但輸出類似如下
Entry present in conf file ($D--- is missing)
it should be Subsystem sftp /usr/libexec/openssh/sftp-server #### ####
的變量有什麼辦法來顯示的$ d如果火柴盒?
您從未設置過$ D? – 123
我想你只是想像''$(grep Subsystem/etc/ssh/sshd_config)''執行grep。我不知道D在做什麼 –
什麼是「if火柴盒」? – Jens