650) this.width=650; "src=" Http://s5.51cto.com/wyfs02/M00/8C/17/wKioL1hiDtOToZ39AAPTKCCfJ7g699.png "title=" 1.png " alt= "Wkiol1hidtotoz39aaptkccfj7g699.png"/>
[Email protected] zhouyu]# a= "I am Zhouyu"
[Email protected] zhouyu]# echo ${#a}
11
[Email protected] zhouyu]# echo $a | Wc-m
12
[[email protected] zhouyu]# echo ${a:2}
Am Zhouyu
[[email protected] zhouyu]# echo ${a:2:3}
Am
[Email protected] zhouyu]# echo $a | Cut-b 3-4
Am
[[email protected] zhouyu]# echo ${a#i am}
Zhouyu
[[email protected] zhouyu]# echo ${a# #i am}
Zhouyu
[[email protected] zhouyu]# echo ${a%zhouyu}
I am
[[email protected] zhouyu]# echo ${a%%zhouyu}
I am
[Email protected] zhouyu]# echo ${a/i am/you is}
You are Zhouyu
[email protected] zhouyu]#
Below we write a script let 1_zhouyu.txt 2_zhouyu.txt 3_zhouyu.txt the name of three files renamed to 1.txt 2.txt 3.txt file, how to change it. can refer to the following documents I wrote
What better way to ask Daniel to give a little advice
vim/root/zhouyu/1.sh content is
Cd/root/zhouyu
For i in ' LS *.zhouyu.txt ';
Do
MV $i ${i/_zhouyu.txt/.txt}
Done
That's how it works.
Here is the command rename, which is specifically used to change the file name, as follows:
Rename want to change the part changed to what changes the source file, below is an example
[[email protected] zhouyu]# ls
1.txt 2.txt 3.txt zhouyu.sh
[Email protected] zhouyu]# rename. txt. txt/root/zhouyu/*
[[email protected] zhouyu]# ls
1.TXT 2.TXT 3.TXT zhouyu.sh
[Email protected] zhouyu]#
This article is from "Love Zhou Yu" blog, please be sure to keep this source http://izhouyu.blog.51cto.com/10318932/1886563
Application Technology of shell variable quantum string