Sponsored Content
Full Discussion: Chemist Needs Help
Top Forums UNIX for Dummies Questions & Answers Chemist Needs Help Post 302250950 by jim mcnamara on Friday 24th of October 2008 03:58:51 PM
Old 10-24-2008
Code:
printf "%s\n%s\n%s\n%s\n" "comment" "x y x" "101" "4 7" > newfile
awk '/Done/ {print $2; exit}' Ar_b3lyp_pv5z.out | read col3
awk '/Done/ {print $2; exit}' Cl_b3lyp_pv5z.out | read col4
awk '/Done/ {print $2}' ArCl_b3lyp_pv5z.out | \
awk -v col4="$col4" -v col3="$col3" ' BEGIN { cnt =1.5 }
    {printf("%.1f %s %s %s\n", cnt, $0, col3 col4); cnt+=.1 }'>> newfile

There was a missing comma after the word "cnt" on the last line. I ran it with dummy files, zero errors. Copy and paste this back into your script. There are no syntax errors.
Logic errors, maybe.
 

We Also Found This Discussion For You

1. UNIX for Dummies Questions & Answers

Chemist Needs Help part II

Hello friends, I was wondering if you can help me with probably a simple function to you all: the sample looks and has this format. I was wondering how I could extract the first and second column starting including the line 'E/N and Ko' and not stop until there are no more lines. Thank you for... (5 Replies)
Discussion started by: gingburg
5 Replies
script(1)						      General Commands Manual							 script(1)

NAME
script - Makes a transcript of terminal session SYNOPSIS
script [-a] [file] The script command makes a transcript of everything printed on your terminal. OPTIONS
Appends the transcript to file rather than writing it to file. OPERANDS
The name of an output file that will contain the transcript of the session. If this parameter is omitted, the file typescript is written. DESCRIPTION
The transcript is written to file, or appended to file if the -a option is given. If no file name is given, the transcript is saved in the file typescript. The script ends when the forked shell exits. This program is useful when you are using a CRT and want a hard-copy record of the dialog (for example, a technical writer might create an example of a working session this way). If you specify the -a option and the file does not exist, it is created. If you do not specify the -a option and the file exists, it is replaced. RESTRICTIONS
The script command requires a streams based terminal. In single user mode, streams may not be enabled. Under these circumstances, script will exit with no action. If you are the superuser and need to run this command in single user mode, use the following special instruc- tions. Enabling Streams If it is necessary to enable a streams environment in the single user mode, enter the command /sbin/init.d/streams. This command is avail- able to the superuser only. SEE ALSO
Commands: autopush(8), cat(1), echo(1), strsetup(8), tee(1) System Administration script(1)
All times are GMT -4. The time now is 07:54 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy