unix - Extract part of file name using KornShell -


i have file name, example: xxdatafile_20110120123030_12342.dat. want extract "xxdatafile_" file name.

how do using ksh on unix?

$ file=xxdatafile_20110120123030_12342.dat $ echo ${file%%_*} xxdatafile 

Comments

Popular posts from this blog

java - SNMP4J General Variable Binding Error -

sql server - python to mssql encoding problem -

windows - Python Service Installation - "Could not find PythonClass entry" -