1 cat /etc/shells 查看計算機上可用的shell 2 編寫shell,保存為firstscript
#! /bin/bash # This is a test. echo -n Your current directory is: pwd echo $HOME echo Your current directory is: pwd #END.
#!/bin/sh echo -n Please input your ID: read id_var echo -n Please input your password: read password echo User ID = $id_var echo password = $password if [ $password = "admin" ]; then echo "password is right" else echo "password is wrong" fi