shell scripting
can some1 please tell me ....i am writing script to display type of file....and i m not able to get what "filename##*\." means?....please be brief in your explanation..thank you
the program is like: for filename in$(ls) do ext=${filename##*\.} case '$ext' in |
Need some context...
edit: thanks for the edit, looks like rknichols answered it. |
${filename##*\.} is the value of $filename with all leading characters up to and including the last "." character deleted. (The backslash escape on the "." is superfluous.)
${varname#*.} drops all leading characters up through the first "." (shortest string that matches "*.") The double "##" looks for the longest match. It's all in the bash manpage under "Parameter Expansion". |
All times are GMT -5. The time now is 07:18 PM. |