In a bash file test.sh
, I put
#!/bin/bash
dirpath="/home/dir"
myfile="$dirpath/file with white space"
awk '{print "firstcolumn"$1":"$4,$2}' ${myfile}.bim >file2
When I run the script sh test.sh
, I receive an error saying
awk: fatal: cannot open file '/home/dir/file' for reading (No such file or directory)
. How do I make awk to deal with file with whitespaces?
I tried file\ with\ white\ space as well but doesn't work.