Chinaunix

标题: [SOLARIS]how to write this script? [打印本页]

作者: netbanker    时间: 2002-04-29 01:39
标题: [SOLARIS]how to write this script?
I wanna to get the suffix of a file name, for example: if the filename is aaa.gz, i wnat to get \'gz\'

I wrote a command use `echo $filename | cut -f2 -d \'.\' `,but if the . exist in filename,it will not work.

any suggestion?

thx!~




欢迎光临 Chinaunix (http://bbs.chinaunix.net/) Powered by Discuz! X3.2