shell脚本攻略读书笔记之一
shell 脚本 攻略 之一 读书笔记
2023-09-14 09:13:16 时间
Shell脚本攻略读书笔记之一
[root@server5 local]# echo "hello shell"
hello shell
[root@server5 local]# printf "hello shell"
hello shell[root@server5 local]# # printf "hello shell\n"
hello shell
[root@server5 local]#
(1)(-表示左对齐,没有则表示右对齐)
(2)赋值语句的等号左右切记不要有空格!
(3)第一个echo hello会被视作一个命令,第二个hello会被单独视为一个命令!
[root@server5 local]# echo hello;hello
hello
-bash: hello: 未找到命令
(4)bash不会对单引号中的变量(如$var)求值,而只是照原样输出。
(5)while using flags for echo and printf, always make sure that
the flags appear before any strings in the command,otherwise Bash will consider the flags as another string.
What's meaning of "flags?"
(6)[root@server5 local]# echo -e "\e[1;31m this is red txt \e[0m"
this is red txt \e[1;31m is the escape string that sets the color to red
\e[0m resets the color back.
相关文章
- shell脚本实现mysql自动登录
- 【shell 脚本】求最大公约数
- linux shell 脚本攻略学习16--wc命令详解,tree命令详解
- linux shell 脚本攻略学习11--mkdir和touch命令详解
- linux shell 脚本攻略学习8---md5校验,sort排序,uniq命令详解
- linux shell 脚本攻略学习2
- 使用shell脚本运行scala
- Linux终端执行shell脚本,提示权限不够的解决办法
- linux shell 脚本攻略学习17--正则表达式入门
- linux shell 脚本攻略学习4
- linux shell 脚本攻略学习2
- linux shell 脚本攻略学习1
- Shell脚本中替换字符串等操作
- 如何在linux Shell脚本里面把一个数组传递到awk内部进行处理
- shell脚本实现检測回文字符串
- shell脚本学习笔记(符号)
- 18.第六章 Shell脚本编程基础入门 -- 编程基础和shell脚本语言的基本用法(一)
- shell脚本获取文件中的版权(Copyright)
- Shell 简单跳板机脚本
- Shell 脚本中if的用法
- Shell脚本攻略读书笔记之三
- 《Shell脚本攻略读书》笔记二之$命令的使用
- Shell脚本一键安装-----Tomcat服务
- Rsync 文件同步(二):shell 脚本定时备份数据
- Shell脚本中利用expect实现非交互式