- #1
zeion
- 466
- 1
Hi,
I'm new to Bash scripting and I need some help with this:
I need to echo only a specified range of words from a string based on index;
so for example if I had:
a="hello how are you today"
Is there a way to echo only "how are you" by specifying the index 2 to 4?
(in one line, possible with one command and without a loop or array?)
Thanks.
I'm new to Bash scripting and I need some help with this:
I need to echo only a specified range of words from a string based on index;
so for example if I had:
a="hello how are you today"
Is there a way to echo only "how are you" by specifying the index 2 to 4?
(in one line, possible with one command and without a loop or array?)
Thanks.