Edit:
I simply need to strip the .gz
SUBMIT joust_aallgeier_attempt_2015-11-12-20-37-40_project04.tar.gz
These are gunzipped already.
I need project.tar
output
I have the following stripping the first portion.
filename=${j##*_}
Edit:
I simply need to strip the .gz
SUBMIT joust_aallgeier_attempt_2015-11-12-20-37-40_project04.tar.gz
These are gunzipped already.
I need project.tar
output
I have the following stripping the first portion.
filename=${j##*_}
With bash's Parameter Expansion:
filename="SUBMIT joust_aallgeier_attempt_2015-11-12-20-37-40_project04.tar.gz"
stripped="${filename##*_}"
stripped="${stripped%.gz}"
echo "$stripped"
Output:
project04.tar