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 463 views
2 answers 436 views
1 answer 365 views
1 answer 354 views
2 answers 499 views
1 answer 345 views
2 answers 736 views
...