Sponsored Content
Full Discussion: Chemist Needs Help
Top Forums UNIX for Dummies Questions & Answers Chemist Needs Help Post 302251209 by gingburg on Saturday 25th of October 2008 07:02:42 PM
Old 10-25-2008
Quote:
Originally Posted by jim mcnamara
Yes. Those come from this:
Code:
awk '/Done/ {print $2; exit}' Ar_b3lyp_pv5z.out | read col3

This just reads the first 'Done' line from the file. YOu need run this
Code:
awk '/Done/ {print $2; exit}' Ar_b3lyp_pv5z.out

and see what you get. I suspect you get nothing. In that case, play with this line awk statment until it produces what you want. Duplicate your efforts on the other line that creates col4. Dont forget to add the | read col3 and read | col4 statements back onto the line.

If you know what the values are supposed to be anyway, hardcode them in, skip the awk for now example:
Code:
col3=99999
#awk '/Done/ {print $2; exit}' Ar_b3lyp_pv5z.out | read col3

The leading # character comments out the line. Repeat this for the col4 line.

It seems when I run the awk '/Done/ {print $5; exit}' Ar_b3lyp_pv5z.out in the command line I do get my one value that I want to repeat 101 times. But when I run the entire script everything is printed except for columns 3 and 4.

Any thoughts. Thanks.

Also I don't know if you care or not but this is technically not my work but yours so I should cite your name as a reference. That's up to you.
 

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 09:43 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy