How to remove the last character of a string in Bash

1 Answer

0 votes
s="bash Unix shell and command language"
 
s=${s%?}

echo $s
 
 
 
 
# run:
#
# bash Unix shell and command languag
#

 



answered Feb 6, 2021 by avibootz

Related questions

1 answer 314 views
1 answer 215 views
1 answer 198 views
2 answers 314 views
2 answers 285 views
1 answer 246 views
1 answer 245 views
...