BASH If-then-else Scripting Help
I know this is a really stupid question, but can anybody tell me what is wrong with this?? I haven't got a clue!! It seems like its correct! But it errors....
Code:
#!/bin/bash Code:
./test: line 13: syntax error near unexpected token `then' |
Re: BASH If-then-else Scripting Help
Quote:
Philipp Edit: okay, that doesn't work... try putting else on the next line? |
IT WAS A SPACE BETWEEN THE IF AND THE [
THANKS!! |
There are too much dollars in your code !
Remove those on the left side of assignments (e.g. $nextchar="1"; should be nextchar=1) . |
Two of the answers came up while I was preparing my response.
Why not use Forename=${NAME_STRING% *} Sirame=$[NAME_STRING#* } Also, for ${var:n:m} if the offset is negative, you may need to write it ${var:$(( n )):m} |
All times are GMT -5. The time now is 05:54 PM. |