আমার কাছে একটি স্ক্রিপ্ট রয়েছে যা আমি তৈরি করছি এবং এটি নিয়ে আমার একটি সমস্যা রয়েছে: আমি মৃত্যুদন্ড কার্যকর করতে বিরতি দিতে এবং ব্যবহারকারীর ইনপুটটির জন্য অপেক্ষা করতে চাই। আমি ভেবেছিলাম আমার read -p -n 1 $fooকমান্ডটি দিয়েছিল তবে এই কমান্ডটিতে সিস্টেমের সমস্যা রয়েছে। এখানে আমার বর্তমান স্ক্রিপ্ট:
#!/bin/sh
# Ititialization
mainmenu () {
echo "Press 1 to update your system"
echo "Press 2 to install samba"
echo "Press 3 to install vsFTPd"
echo "Press 4 to install the current version of Webmin"
echo "Press 5 to configure samba for Active Directory"
echo "Press x to exit the script"
read -n 1 -p "Input Selection:" mainmenuinput
if [ "$mainmenuinput" = "1" ]; then
updatesystem
elif [ "$mainmenuinput" = "2" ]; then
installsamba
elif [ "$mainmenuinput" = "3" ]; then
installvsftpd
elif [ "$mainmenuinput" = "4" ]; then
installwebmin
elif [ "$mainmenuinput" = "5" ]; then
configuresambaforactivedirectory
elif [ "$mainmenuinput" = "x" ];then
quitprogram
elif [ "$mainmenuinput" = "X" ];then
quitprogram
else
echo "You have entered an invallid selection!"
echo "Please try again!"
echo ""
echo "Press any key to continue..."
read -n 1
clear
mainmenu
fi
}
# This builds the main menu and routs the user to the function selected.
mainmenu
# This executes the main menu function.
# Let the fun begin!!!! WOOT WOOT!!!!
আপনি মেইনমেনু ফাংশনে লক্ষ্য করতে পারেন পড়ুন -n 1 -p "পাঠ্য এখানে যায়" এন্ট্রি পড়ুন। উবুন্টু অনুসারে আমি এখানেই সমস্যাটি নিয়ে আসছি। কেউ কি আমাকে বলতে পারে কী ভুল হচ্ছে? ধন্যবাদ!
#!/usr/bin/env bashবা#!/bin/bash।