I have a filename variable that sometimes gets set as:
attachment;
JobRunStatisticsReport_20150122.zip
In the File Manager window, it looks like this:
I need help coming up with an IF statement that says:
IF $filename contains 'attachment; \n' then
and then help with a SED that looks for that new line character (\n) and replaces that and everything before it with nothing.
Can anyone lend a quick hand please?
Your filename actually contains both a carriage return and a newline. bash parameter expansion can handle this:
Does not affect "normal" filenames: