❯ echo filepath.ext{,.bak}
filepath.ext filepath.ext.bak

❯ echo filepath{.ext,.bak.ext}
filepath.ext filepath.bak.ext

❯ FILENAME=myfile.ext
❯ FILE=${FILENAME%.*}
❯ EXTN=${FILENAME##*.}
❯ echo $FILE $EXTN
myfile ext
❯ echo $FILE.{$EXTN,bak.$EXTN}
myfile.ext myfile.bak.ext

 

'OS > Linux' 카테고리의 다른 글

bash {} expansion  (0) 2020.03.28
CENTOS 7 , firewall-cmd Port forwarding  (0) 2019.04.05
nodejs 설치 in CentOS  (0) 2019.03.21
CentOS 7 Full NAT 설정, Secondary IP 추가  (0) 2018.11.05
pdnsd로 DNS Proxy 설정하기  (0) 2018.11.05
firewalld 설정  (0) 2018.11.04

+ Recent posts