Bash Scripting - Text Processing in Scripts
You want to extract the 2nd and 4th fields from a colon-separated file and then paste them side by side separated by a semicolon. Which command sequence achieves this?
cut -d ':' -f 2 file.txt pipes field 2 values to paste stdin; <(cut -d ':' -f 4 file.txt)> provides field 4 via process substitution.paste -d ';' - <(cut ...)> joins corresponding lines from both inputs with semicolon.15+ quiz questions · All difficulty levels · Free
Free Signup - Practice All Questions