to remove zero from right
cat <<EOF | sed -r 's/0*\s|0*$/ /g; s/\. / /g'
0.0
1.0
0.10
1.10
1.0050
EOF
to remove zero from right
cat <<EOF | sed -r 's/0*\s|0*$/ /g; s/\. / /g'
0.0
1.0
0.10
1.10
1.0050
EOF
options=(
"SHOW USERNAME"
"LIST FILES"
"Quit"
)
select option in "${options[@]}"; do
case $option in
${options[0]}) whoami ;;
${options[1]}) ls ;;
${options[2]}) exit ;;
*) echo invalid option ;;
esac
done
ngrok tcp 22 --log=stdout > ~/ngrok.log &
awk 'NR%2==0 { print "\033[40;1m" $0 "\033[m"} NR%2 { print }' <( seq 20 | pr -4t )
echo $(( $( date +%s )-$( date -r /etc/passwd +%s ) ))
get last false until the end of file
cat <<EOF | sed -n 'H; /false/h; ${g;p;}'
1 true
2 false
3 true
4 false
5 true
6 true
EOF