shell script - you get all the files folder

shell script is as follows:

. 1 #! / Bin / the bash
 2  all files # acquired folder
 . 3  #
 . 4 Folder = " / mnt / Soft " 
. 5  
. 6 softfiles = $ ( LS $ Folder)
 . 7  for sfile in $ {softfiles}
 . 8  do  
. 9      echo  " Soft : $ {} sfile " 
10  DONE

Execute the following script:

 

 

The tgz tail removed, leaving the file name can be used as follows: $ {sfile% .tgz}

 echo "tail removed tgz = $ {sfile% .tgz}"

 

Guess you like

Origin www.cnblogs.com/zzming/p/12608314.html