Почему bash не позволяет мне редактировать эту строку? - PullRequest
0 голосов
/ 22 февраля 2019

Приведенное ниже эхо постоянно возвращает мне пустую строку.Я не понимаю почему.Разве все в bash не действует как глобальная переменная?

# Deals with all the cases of having a file vs stdin
out_to_file="N"
#  Check to see if the user is running a file or just commandline input
if [ $# -ge 3 ];then
    out_to_file="Y" 
else  # The user is not running a file so ask them if they want to output to a file
    read -p "Output to a file? [y/n] " out_to_file 
fi
echo $out_to_file
Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...