How to get the char at a given position of a string in shell script?
Tell me more
×
Unix & Linux Stack Exchange is a question and answer site for
users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.
|
In bash with "Parameter Expansion" ${parameter:offset:length}
Edit: Without parameter expansion (not very elegant, but that's what came to me first)
|
||||
|
|
|
Alternative to parameter expansion is
For example:
|
|||
|
|
