sedの使用コマンドプロンプト内のコード行を削除できます。私はbashスクリプトの中でそれを使用して変数を使用すると、それを削除しません。特定の変数からの行の削除
function remove_user {
echo "Input user you would like to delete"
read rui
if grep -q $rui database.txt ;
then
echo "Are you sure yu want to delete this user?"
echo "(Y/N)"
read input3
if [ $input3 == "Y" ] || [ $input3 == "y" ] ;
then
sed -i '/"$rui"/d' ./databse.txt
echo "User Deleted"
echo "returning to the main menu..."
echo "$rui"
#sleep 1 ; clear
elif [ $input3 == "N" ] || [$input3 == "n" ] ;
then
echo "returning to main menu..."
sleep 1 ; clear
else
echo "input invalid"
echo "returning to main menu..."
sleep 1 ; clear
fi
else
echo " user not found"
echo "returning to main menu..."
sleep 1 ; clear
fi
私のデータベースは、この
ラリーのようになります。[email protected]:ラリー・ボブ:ATC:コードは、変数とだけではない動作しますので、問題は何ができるか4.0
わかりません
http://www.shellcheck.net/ – Cyrus