2011-02-18 24 views
0

我有一個filewatcher.txt文件。我想在現有的unix腳本(final)中包含一段代碼,它會要求用戶輸入(Y/N)來檢查文件是否已被重命名(* filewatcher.txt egSAV_filewatcher.txt或xyz_filewatcher.txt)或原始名稱(filewatcher.txt)存在。 如果文件觀察器尚未重命名,則現有代碼(最終)將退出。在現有的unix腳本中包含一段代碼

回答

0

我還不能肯定我明白你在找什麼做的,但這裏有幾個基本的腳本提示:

if [ -f "filewatcher.txt" ]; then 
    echo "file has not been renamed" 
fi 

echo "Please give me some input" 
read var 
echo "Your input was $var"