Split string by multiple delimiters in bash - Linux Tips And Tricks

Published: 14 January 2023
on channel: Rabi Gurung
421
3

Learn how to split string by multiple delimiters in bash.

Command featured in this video.
uptime | awk -F'( |,|:)+' '{print $2,$3,$4}'

uptime | awk -F'( |,|:)+' '{print $2,$3,$4,$5,$6,$7,$8,$9,$10,$11,$12,$13,$14,$15,$16}'

uptime | awk -F'( |,|:|o)+' '{print $2,$3,$4,$5,$6,$7,$8,$9,$10,$11,$12,$13,$14,$15,$16}'

Additional useful command
uptime | awk -F'( |,|:)+' '{print $6,$7",",$8,"hours,",$9,"minutes."}'

#linux #ubuntu #redhat #bash


Watch video Split string by multiple delimiters in bash - Linux Tips And Tricks online without registration, duration hours minute second in high quality. This video was added by user Rabi Gurung 14 January 2023, don't forget to share it with your friends and acquaintances, it has been viewed on our site 421 once and liked it 3 people.