Thread: Bash: Please explain ${var##*.}
i'm using bash find last part of string e.g. 'myfile.3' - found method works, don't know why!
should googling find out more this? reg exp or else?
code;
that returns '46', correct (i.e. 45+1) - need understand var##*. piece. how saying 'go end of string, part after '.', , return that'code:var=my.test.file.23.45 echo $(( ${var##*.} + 1 ))
look @ bottom of page, explains well.
http://mywiki.wooledge.org/bashguide/parameters
in order answer question should searching it's called parameter expansion.
Forum The Ubuntu Forum Community Ubuntu Specialised Support Development & Programming Programming Talk [SOLVED] Bash: Please explain ${var##*.}
Ubuntu
Comments
Post a Comment