标签:rom which 浮点数 一个 from find shang use com
a=ddd
echo $a
echo a
echo $p
echo $PATH
which find
which adb
echo $PATH
[ 2 -gt 1 ]
echo $?
ls
a=1
echo $a
b=hello world
b="hello world"
echo $b
echo b
a=‘hello world‘
a
echo $a
b=1
echo "abc $a"
echo ‘abc $a‘
echo "bac $a"
c="today is sunday"
echo "hello,$c"
echo ‘hello,$c‘
echo $ddd
a="hello"
echo $a_1
echo $a _1
echo ${a}_1
b="sunday"
ehco ${b}
echo ${b}
pwd
$PWD
echo $PWD
echo $USER
echo $path
echo $PATH
echo $home
echo $HOME
a=1
b=(1 2 3 4 5)
echo $a
echo $b
echo ${a[*]}
echo ${b[*]}
echo ${b[4]}
echo ${#b[*]}
which python
which 1.sh
ls
which file.out
a=`ls`
echo $a
ls
array=(`ls`)
echo "print(3*7)" | python
echo $array
echo ${array[*]}
echo ${#array[*]}
echo ${array[6]}
echo ${array[-1]}
echo "a\nbbb"
echo -e "a\nbbbb"
echo "a\\"bbbb"
my dir is `ls`
echo my dir is `ls`
echo my dir is ${ls}
echo my dir is $(ls)
a=4;b=7
echo $((a+b))
echo $(($a+$b))
echo $((a-b))
echo $(3+2)
echo $((3+5))
a=4;b=2;c=3
echo $((a+b*c))
a="hello world is a happy day"
echo $a
echo hello world luming com
a=33444
echo $a
echo $((a+2))
echo $((4+a))
echo $((a/4))
echo $((a*6))
a=5
((a=a+5))
echo $a
((a=a*6))
echo $a
((a++));echo $a
((a--));echo $a
a=4;b=6
((a<b))
echo $?
((a>b))
echo $?
echo $((2/3))
echo $((3/2))
awk ‘BEGIN{print 2/3}‘ 除数支持浮点数据
s="hello from china"
echo $s
echo ${6}
echo ${s}
echo ${:6}
echo ${s:6}
echo ${s:6:3}
echo ${s:6:5}
echo ${#s}
echo $s
echo ${s#hello}
echo $s
echo "${s#china}"
echo "${s#chinaa}"
echo "${s#ccc}"
echo "${s#*m}"
echo "${s#*l}"
echo "${s#*a}"
echo "${s#*n}"
echo "${s#*o}" *放在前面
echo "${s##*o}" 贪婪匹配,匹配至最后一个(掐头)
echo "${s%na}" 去尾
echo "${s%h*}" *放在后面
echo "${s%%o*}" 贪婪匹配
echo "${s/china/shanghai}" china为被替换的内容,shanghai为替换的内容
echo -e "1|2|3\n4|5|6\n7|8|9" 输出的结果为:
1|2|3
4|5|6
7|8|9
标签:rom which 浮点数 一个 from find shang use com
原文地址:https://www.cnblogs.com/godlove/p/11479860.html