Linux中$的作用

Linux中$的作用

有两种解释:
(1) [redhat@station5 ~]$ 此处是指普通用户的提示符,root为#
(2) 在脚本中是指申明变量,如:
#!/bin/bash
for ip in $( seq 1 254) (此处是申明数字变化范围1到254)
do
ping -c1 -w1 192.168.0.$ip &>/dev/null && echo station$ip is up || echo station$ip is down | grep up
done
温馨提示:答案为网友推荐,仅供参考
相似回答