I have a ksh script that has to remain so (some of the programs it runs insist on being ksh). I want to take the input argument "test.txt" and remove the last 4 characters or find and replace the ".txt" with nothing.
In bash I would do
NewVar=${@/.txt/}
This doesn't work in ksh though. How can I get rid of the .txt in ksh? I tried
bash -c 'NewVar=${@/.txt/}'
but it didn't work the $@ variable into this newly created shell.
Thanks,
Dan