How to remove the first character of a string in Bash

2 Answers

0 votes
s="bash Unix shell and command language"
 
s="${s:1}"

echo $s
 
 
 
 
# run:
#
# ash Unix shell and command language
#

 



answered Feb 6, 2021 by avibootz
0 votes
s="bash Unix shell and command language"
 
s=${s#?}

echo $s
 
 
 
 
# run:
#
# ash Unix shell and command language
#

 



answered Feb 6, 2021 by avibootz

Related questions

1 answer 314 views
2 answers 278 views
1 answer 251 views
1 answer 248 views
2 answers 347 views
1 answer 214 views
2 answers 567 views
...