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 463 views
1 answer 345 views
1 answer 319 views
2 answers 482 views
2 answers 435 views
1 answer 386 views
1 answer 362 views
...