Categories
How to remove a space from the beginning of a string in a bash variable?
There is a variable a=" 12345" How to get a="12345" without a space at the beginning of the string?
b=${a/ //} #не срабатывает b=${a:1} #тоже
Answer the question
In order to leave comments, you need to log in
$ a=" 12345" $ echo "-${a:1}-" -12345- Why this option doesn't work for you, I don't understand - everything is OK echo ${a// /} 12345 here just swap the arguments
Didn't find what you were looking for?
Ask a Question
731 491 924 answers to any question