bondtrails
Technical User
Hi everyone,
I can't seem to get shell quoting correct in a unix script.
I tried this command in the command line, and it works great:
awk -v file="input1.dat" -f program.awk input2.dat > output.dat
but i can't seem to make it work in a script--I've tried a few quoting combination but so far no go. Here's what I've got:
#! /bin/sh
FILE_1=$1
FILE_2 =$2
OUT=$3
DIR="/Volumes/data store/current files"
COMMAND=awk
PARM'-v fna='"$DIR/$FILE_1"' -f program.awk'
$COMMAND $PARM "$DIR/$FILE_2" > "$DIR/$OUT"
this doesn't work the way it should! Can someone help out??
--Bondster!!
P.S. note that in the line defining PARM, double quotes surround the $DIR/FILE_1 (not 3 single quotes, as it may seem)
I can't seem to get shell quoting correct in a unix script.
I tried this command in the command line, and it works great:
awk -v file="input1.dat" -f program.awk input2.dat > output.dat
but i can't seem to make it work in a script--I've tried a few quoting combination but so far no go. Here's what I've got:
#! /bin/sh
FILE_1=$1
FILE_2 =$2
OUT=$3
DIR="/Volumes/data store/current files"
COMMAND=awk
PARM'-v fna='"$DIR/$FILE_1"' -f program.awk'
$COMMAND $PARM "$DIR/$FILE_2" > "$DIR/$OUT"
this doesn't work the way it should! Can someone help out??
--Bondster!!
P.S. note that in the line defining PARM, double quotes surround the $DIR/FILE_1 (not 3 single quotes, as it may seem)