Hi i have a script that reads a file and parses the file like this:
!set NISSE=.
!set KALLE=%NISSE%\hejsan\dejsa
n
%NISSE%\lisa.txt
%KALLE%\jesper.txt
The thing i want the script to do is run it and check if all the files exists like this:
pars the !set to be set as env variables
and then run "ls" on the files to se if they exist.
The problem here is the env variables dont get set they get set as
NISSE="."
KALLE="\$NISSE/hejsan/dejs
an
The shell escapes the $ i have tried in every whay to escape the escape....?!? if you know what i mean.
The script looks like this at the moment:
MakeEnv () {
`egrep '^!set -f' $file | sed -e 's|!set -f \(.*=\)\([^ ]\+\)|export \1"\2"|g' | sed 's|\%\([A-Z_]\+\)\%|$\1|g'
| sed 's|\\\\|/|g'`
}
im confused ;)
/R
Start Free Trial