awk script continued...

Posted on 2009-04-16
Last Modified: 2013-11-13
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.

(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

Question by:mbpssgms
    LVL 84

    Accepted Solution

    print /home/gav/DOCKING/AUTODOCK/SCRIPTS >"/tmp/FLXDOCK"

    Author Comment

    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

    Author Comment

    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: line 1: unexpected EOF while looking for matching `''
    ../../../SCRIPTS/SETFLEX2: line 2: syntax error: unexpected end of file

    Author Closing Comment

    To fix used other script

    Featured Post

    Top 6 Sources for Identifying Threat Actor TTPs

    Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

    Join & Write a Comment

    Here we come across an interesting topic of coding guidelines while designing automation test scripts. The scope of this article will not be limited to QTP but to an overall extent of using VB Scripting for automation projects. Introduction Now…
    How to remove superseded packages in windows w60 or w61 installation media (.wim) or online system to prevent unnecessary space. w60 means Windows Vista or Windows Server 2008. w61 means Windows 7 or Windows Server 2008 R2. There are various …
    Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …
    In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…

    730 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    15 Experts available now in Live!

    Get 1:1 Help Now