Hello,
I have to write a very simple shell (I am not used to this at all).
I used grep to put a line from a file in a variable like so :
Suivi_Id=$(grep "Suivi_Id" ${FILE})
echo $Suivi_Id prints : Suivi_Id123
I want only 123
so I tried (and tried, and tried...)
for example : Suivi_Id=${$Suivi_Id:8}
or Suivi_Id=${Suivi_Id:8}
result (both cases) : bad substitution
I also tried
l_Suivi=`expr length $Suivi_Id`
Suivi_Id= `expr substr $Suivi_Id 8 $(l_Suivi)`
result (both lines) expr: syntax error
I tried with $ or not, with {or( or not ...
I know it must be some very simple and stupid thing ...
Thank you !
I have to write a very simple shell (I am not used to this at all).
I used grep to put a line from a file in a variable like so :
Suivi_Id=$(grep "Suivi_Id" ${FILE})
echo $Suivi_Id prints : Suivi_Id123
I want only 123
so I tried (and tried, and tried...)
for example : Suivi_Id=${$Suivi_Id:8}
or Suivi_Id=${Suivi_Id:8}
result (both cases) : bad substitution
I also tried
l_Suivi=`expr length $Suivi_Id`
Suivi_Id= `expr substr $Suivi_Id 8 $(l_Suivi)`
result (both lines) expr: syntax error
I tried with $ or not, with {or( or not ...
I know it must be some very simple and stupid thing ...
Thank you !