Unix substr in shell script?
Posted
by KnockKnockWhosThere
on Stack Overflow
See other posts from Stack Overflow
or by KnockKnockWhosThere
Published on 2010-03-24T20:42:10Z
Indexed on
2010/03/24
20:43 UTC
Read the original article
Hit count: 444
I have a string like sample.txt.pgp and I want to return sample.txt in a shell script. Is there a substr function? Like, if I did substr('sample.txt.pgp', -4, 0)
, is it supposed to return sample.txt? Right now it isn't, so I'm wondering if I have the syntax wrong, or maybe substr isn't a function?
© Stack Overflow or respective owner