条件语句并读取值

时间:2019-06-16 00:57:19

标签: bash shell loops conditional-statements

我写了一个脚本,想知道我犯的错误

在ubuntu中运行,但出现了一些错误

#!/bin/bash
echo "Enter Your Name"
read name
echo "Welcome $name to cff"
done

#Run the file with bash command.
$ bash user_input.sh

echo "Enter username”
read username
echo "Enter password”
read password
if [[ ( $username == "admin" && $password == "secret" ) ]]; then
echo "valid user”
else
echo "invalid user”
fi

#Run the file with bash command.
$ bash if_with_AND.sh

file='book.txt'
while read line; do
echo $line
done < $file

#Run the file with bash command.
$ bash read_file.sh

#Run the following command to check the original content of ‘book.txt’ file.
$ cat book.txt

echo All done

这个脚本好吗,我希望它很好 我想知道如何将3个脚本链接在一起

0 个答案:

没有答案