shell Delete first and last one or two characters

shell Delete first and last one or two characters

echo "1234aaa" | sed 's/.$//'  #the last one
echo "1234aaa" | sed 's/..$//' #the last two

echo "1234aaa" | sed 's/.//'  #the first one
echo "1234aaa" | sed 's/..//' #the first two

Comments

Popular posts from this blog

Python Receiving and parse JSON Data via UDP protocol

ubus lua client method and event registration code demo/example