#!/bin/bash
function main_menu()
{
echo Simple Linux Utility
echo 0) Repeat last command
read -p "Choose your option : " input
case $input in
0)
!!;;
*)
exit;;
esac
}
main_menu
exit 0
的问题是: “简单重复的最后命令中使用的变量要记住的最后一个数字。” 和我无法写入任何数据到外部文件如何重做shell脚本中的最后一个命令?
但我不吨知道如何重复最后的命令在shell脚本 我不能使用! !-1在shell脚本中,它会显示为错误
我没有看到脚本... – rbaleksandar
我认为[这](http://unix.stackexchange.com/questions/147563/how-do-i-repeat-the-last-command-without-使用箭头键)可以帮助你。 – ganchito55