![](https://img-blog.csdnimg.cn/20201014180756928.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
Shell
闲置的橙
这个作者很懒,什么都没留下…
展开
-
Shell脚本编程(功能语句read)
read var#!/bin/bashecho -n "input 2 words:"read var1 var2echo $var1 $var2echo "input:\c"read var3echo $var3结果aston@ubuntu:~/test$ ./pro1.sh input 2 words:aa bbaa bbinput:\ccccc发现 \c 没有起作用,将首行的bash改sh#!/bin/shecho -n "input ...原创 2021-06-26 13:41:52 · 76 阅读 · 0 评论 -
Shell脚本编程(环境变量)
HOME :/etc/passwd 用户主目录PATH:shell搜索路径HISTSIZE:历史命令容量aston@ubuntu:~/test$ echo $HOME/home/astonaston@ubuntu:~/test$ echo $PATH/home/aston/bin:/home/aston/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/loc.原创 2021-06-26 11:48:16 · 100 阅读 · 0 评论 -
Shell脚本编程(位置变量)
$0 执行文件名语句$1,$2 ...... $9 命令行的九个参数$# 参数个数(不包括$0)$@ 或 $*所有命令行参数$$ 正在执行进程的ID号$? 包含前一个命令的退出状态例子echo $#echo $*echo $@echo '\$0'---$0echo '\$3'---$3echo '\$4'---$4echo '\$10'---${10}echo '\$11'---${11}当出现两位数时,最好加个{ },避免输出非理想结果结果...原创 2021-06-26 11:38:50 · 165 阅读 · 0 评论