Filename manipulation in bash
imgfile="/tmp/scrotout$(date +%s).png" imgleaf=${imgfile##*/} imgstem=${imgleaf%.png} imgjpg="${imgstem}.jpg" imgurl="http://p.im9.eu/$imgjpg" echo $imgleaf echo $imgstem echo $imgjpg echo $imgurl
filepath, path, basename, dirname,
extension, leaf, stem
0 comments:
Post a Comment