bash y/n
rad by som podmienil spustanie jednotlivych krokov v shell scripte "Y/N" potvrdenim. Viete mi prosim poradit ako upravit tento script aby pri "Y" zbehol prikaz, a pri "N" skoncil?
Dakujem.
#!bin/bash
# Must run as root
if [ $(whoami) != "root" ]; then
echo "You need to run this script as root."
echo "Use 'sudo ./$script_name' then enter your password when prompted."
else
read -p "Continue (Y/N):"
[ "REPLY" =="Y" ] || vytvorenie "xz" suboru
[ "REPLY" !="Y" ] || die
Pre pridávanie komentárov sa musíte prihlásiť.
http://tldp.org/LDP/Bash-Beginners-Guide/html/sect_09_06.html