Function: Title
Code:
#!/bin/shrecursive ( ) { for file in $1 do subfile= ' ls $2$3/$file ' for subsubfile in $subfile do # echo $subsubfile if [ "$subsubfile" == "$2$3/$file" ] then rm -rf $3/$file mv $subsubfile $3/$file else recursive ' ls $2$3/$file ' $2 $3/$file; fi done done}cd / tmpmkdir update;tar -zxvf update.tgz -c update;chmod -r 755 /tmp/ Update/*;rootdir= "/tmp/update" filelist= ' ls /tmp/update/' for file in $filelistdo Subfile= ' ls $rootdir/$file ' for subsubfile in $subfile do if [ "$subsubfile" != "$rootdir/$file" ] then $ (recursive ' ls $rootdir/$file ' $rootdir / $file) # rm -rf /$file/$subfile # mv $rootdir/$file/$subsubfile /$file break 1; else kill -9 ' ps|grep $file ' rm -f /usr/bin/$file mv $rootdir/$file /usr/bin fi donedone#reboot
The following are the newly added
Create a soft link for all the files under the folder, the link file can be specified to save to a different directory
When FileList is assigned, you can specify the source path,
In the following "Ln-s $file arm-linux-" $LASTWD "", you can specify the directory of the linked file, such as the source path is the current path, the target path is the current path
#/bin/bash
filelist= ' ls./'
For file in $filelist
Do
firstwd= $file | Cut-d "-"-f1
# if ["$firstwd" = = "Arm"]
# Then
Lastwd= ' echo ' $file | Sed ' s/.*-< Span style= "border:0px;padding:0px;margin:0px;vertical-align:0px;line-height:normal;" >[ ]$/\1/"
Echo $LASTWD
Ln-s $file arm-linux-"$LASTWD"
# fi
Done
This article is from the "QT Development" blog, make sure to keep this source http://2161404.blog.51cto.com/2151404/1825919
Shell recursive function---loop copy file to the specified directory