I have a file name, for example: xxdatafile_20110120123030_12342.dat
. I want to extract "XXdatafile_"
from the file name.
How do I do that u开发者_运维百科sing Ksh on Unix?
$ file=xxdatafile_20110120123030_12342.dat
$ echo ${file%%_*}
xxdatafile
I have a file name, for example: xxdatafile_20110120123030_12342.dat
. I want to extract "XXdatafile_"
from the file name.
How do I do that u开发者_运维百科sing Ksh on Unix?
$ file=xxdatafile_20110120123030_12342.dat
$ echo ${file%%_*}
xxdatafile
上一篇:肛乳头瘤手术多少钱?
精彩评论