How to remove space from word while passing it in array in shell
问题 I am looking for help in reading text from file and passing it into array with space in it. My file is : Pool Library Name Backup Lib1 "Guru Singh" clone Lib2 Raju Tape Lib3 Deepak My Code is : column=1 for arrayname in Pool Library Name; do mapfile -t "$arrayname" < <(awk "NR > 1 {print \$$column}" file.txt) ((column++)) done echo ${Pool[@]} echo ${Library[@]} echo ${Name[@]} Output is [root@Server MM]# echo ${Pool[@]} Backup clone Tape [root@Server MM]# echo ${Library[@]} Lib1 Lib2 Lib3