cut command can be used to split the string with specific split character
command:
echo "18:30:00"|cut -d ':' -f1
18
echo "18:30:00"|cut -d ':' -f2
30
echo "18:30:00"|cut -d ':' -f3
00
command:
echo "18:30:00"|cut -d ':' -f1
18
echo "18:30:00"|cut -d ':' -f2
30
echo "18:30:00"|cut -d ':' -f3
00
No comments:
Post a Comment