Input
/in/archive/ABC/20140111_ABC_018_PART_001.dat
Desired Output:
20140111_ABC_018_PART_001.dat
Command used:
cut -d/ -f4 "/1a/ftproot/archive/ABC/20140111_PR1_018_SALESDOC_ITEM_001.dat"
Problem:
Its actually opening the file 20140111_ABC_018_SALESDOC_ITEM_018.dat
in the path /1a/ftproot/archive/ABC/
and displaying the result from file.
basename /in/archive/ABC/20140111_ABC_018_PART_001.dat
– Stéphane Chazelas Jan 14 '14 at 09:47fn="/in/archive/ABC/20140111_ABC_018_PART_001.dat"; echo "${fn##*/}"
– phemmer Jan 14 '14 at 13:22