Prevent * to be expanded in the bash script
you need to escape your variables, too:
Print "$var"
And in your function:
echo "$1"
Bash intercepting wildcard in script
Try using the -r
flag with read
:
tail -n+2 text.file | while IFS=$'\t' read -r x y z
do
echo "${z}"
done
From the read
man page:
-r Do not treat a backslash character in any special way. Consider each backslash to be part of the input line.
Related Topics
If I Have a Process, and I Clone It, Is the Pid the Same
How to Do 'Ret' Instruction from Code at _Start in MACos? Linux
Bash Sort - How to Sort Using Timestamp
Omitting the First Line from Any Linux Command Output
How to Convert an Image to Grayscale via the Command Line
How to Concatenate Two Strings to Build a Complete Path
What Is the Meaning of Question Marks '' in Linux Kernel Panic Call Traces
How to Automate HTML-To-Pdf Conversions
Different Results Between Ps Aux and 'Ps Aux' Inside a Script
Best Way to Set Environment Variables in Calling Shell
Set Filetype and Comment Key Map with .S File
Unable to Pass Wget a Variable with Quotes Inside the Variable
Unzip All Files in a Directory
How to Purge Disk I/O Caches on Linux
Split Output of Command by Columns Using Bash
How to Prepend a Directory the Library Path When Loading a Core File in Gdb on Linux