Results 1 to 6 of 6
Hi,
I'm trying to use ${VAR:0:4} substring extraction described here:
tldp.org/LDP/abs/html/string-manipulation.html
and it works perfectly if i issue a command in bash.
But when i put it in a script ...
- 07-16-2010 #1Just Joined!
- Join Date
- Jul 2010
- Posts
- 3
Substring Extraction
Hi,
I'm trying to use ${VAR:0:4} substring extraction described here:
tldp.org/LDP/abs/html/string-manipulation.html
and it works perfectly if i issue a command in bash.
But when i put it in a script file and run it, bash gives me "bad substitution" error.
Does anyone know how to fix it?
Thanks
- 07-17-2010 #2Linux User
- Join Date
- Nov 2009
- Location
- France
- Posts
- 292
You may pecise things with sufficient portion of your code to generate the error.
0 + 1 = 1 != 2 <> 3 != 4 ...
Until the camel can pass though the eye of the needle.
- 07-19-2010 #3Just Joined!
- Join Date
- Jul 2010
- Posts
- 3
sorry, didn't get that
- 07-19-2010 #4Linux Newbie
- Join Date
- Mar 2010
- Posts
- 121
- 07-19-2010 #5Just Joined!
- Join Date
- Jul 2010
- Posts
- 3
that was it. Thanks a lot!
- 07-19-2010 #6Linux User
- Join Date
- Nov 2009
- Location
- France
- Posts
- 292
JohnGraham, I'm amazed, you see clearly in the dark !
0 + 1 = 1 != 2 <> 3 != 4 ...
Until the camel can pass though the eye of the needle.


Reply With Quote
