My issue is as follows:
This is the content of variable res:
% echo $res
large__noninteractive($|[[:blank:]])" | grep -E "(^|[[:blank:]])RAM.3000000($|[[:blank:]])" | grep -E "(^|[[:blank:]])CORES.1
And when I do as follows it gives me results (everything after grep -E "(^|[[:blank:]]) and before ($|[[:blank:]])" is the identical to the content of $res) :
cat queuedjobs | grep -E "(^|[[:blank:]])large__noninteractive($|[[:blank:]])" | grep -E "(^|[[:blank:]])RAM.3000000($|[[:blank:]])" | grep -E "(^|[[:blank:]])CORES.1($|[[:blank:]])"
but when I do:
cat queuedjobs | grep -E "(^|[[:blank:]])$res($|[[:blank:]])"
There are no results even though it is supposedly identical. I would appreciate any ideas for solving this issue.
- I'm testing it in the command line but it will enter into a script.
- I made the res as follows:
resource="large__noninteractive RAM.2500000 CORES.4"` res=`echo $resource | sed "s/${queue}//g" | awk '{$1=$1};1' | sed 's/ /($|[[:blank:]])" \| grep -E "(^|[[:blank:]])/g'`