Shell脚本编程

#!/bin/bash  
echo "hello world!"

echo "脚本名是 $0"
echo "脚本参数是 $1和$2"
echo "此命令有 $# 个参数,分别是 $@,当前脚本的PID是 $$"
echo "用户:$USER,主机名:$HOSTNAME,行号:$LINENO"
echo "随机数:$RANDOM"
#!/bin/bash
echo "Do you want to learn hacking technology? Y/N"
read answer
echo "On your answer is $answer"
#!/bin/bash
# Prompt input username and password
read -p 'name:' name
read -sp 'password:' pass
echo "hello $name, your password is $pass"
#!/bin/bash
read -p "age: " age
if [ $age -lt 16]; then
	echo "Please learn hacking technlogy with your parents"
elif [ $age -gt 60 ]; then
	echo "Salute to you"
else 
	echo "Welcome!"
fi

While Cycle

For Cycle

Python

python 端口探测脚本

最后更新于

这有帮助吗?