Link to home
Start Free TrialLog in
Avatar of mbpssgms
mbpssgms

asked on

awk script continued...

Hi, this script updates 2 lines of a file.  But both the file and script must be in the cwd.  How must it be so the user may be in another dir.  The script and file  are in the same dir.
thanks

(mv /tmp/FLXDOCK; awk 'BEGIN{printf "Enter residue and chain information:";getline var < "-";split(var,a)}(NR==35){$7=a[1];}(NR==25){$5=a[1];}{print /home/gav/DOCKING/AUTODOCK/SCRIPTS >"FLXDOCK"}' /tmp/FLXDOCK)

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of ozo
ozo
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of mbpssgms
mbpssgms

ASKER

I wasn't sure what to add where so the script looks like this
(mv /tmp/FLXDOCK; awk 'BEGIN{printf "Enter residue and chain information:";getline var < "-";split(var,a)}(NR==35){$7=a[1];}(NR==25){$5=a[1];}print /home/gav/DOCKING/AUTODOCK/SCRIPTS >"/tmp/FLXDOCK

and my erroris
../../../SCRIPTS/TEST: line 1: unexpected EOF while looking for matching `''
../../../SCRIPTS/TEST: line 3: syntax error: unexpected end of file
gav
Also tried
(mv /tmp/FLXDOCK; awk 'BEGIN{printf "Enter residue and chain information:";getline var < "-";split(var,a)}(NR==35){$7=a[1];}(NR==25){$5=a[1];} print /home/gav/DOCKING/AUTODOCK/SCRIPTS >"/tmp/FLXDOCK"
and got
./../../SCRIPTS/SETFLEX2
../../../SCRIPTS/SETFLEX2: line 1: unexpected EOF while looking for matching `''
../../../SCRIPTS/SETFLEX2: line 2: syntax error: unexpected end of file
To fix used other script