Sponsored Content
Top Forums UNIX for Dummies Questions & Answers Tcsh command for assigning output of awk to variable Post 302901964 by violin on Friday 16th of May 2014 05:08:40 PM
Old 05-16-2014
okay thanks. Now the first line works

set mean = `awk '{ print $1}' $roi.$sid.$task.1D`

but this one does not-
echo $mean $id > mean.$id.txt
it just prints the id in the output file.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Assigning output of command to a variable

Hi, I'm trying to assign the output of a command to a variable and then concat it with another string, however, it keeps overwriting the original string instead of adding on to the end of the string. Contents of test.txt --> This is a test var1="`head -n 1 test.txt`" echo $var1 (This is a... (5 Replies)
Discussion started by: oma04
5 Replies

2. Shell Programming and Scripting

assigning command output to a shell variable

I have the sql file cde.sql with the below contents: abcdefghij abcwhendefothers sdfghj when no one else when others wwhen%others exception when others Now I want to search for the strings containing when others together and ceck whether that does not occur more than once in the... (2 Replies)
Discussion started by: kprattip
2 Replies

3. Shell Programming and Scripting

Assigning output of command to a variable in shell

hi, I want to assign find command result into some temporary variable: jarPath= find /opt/lotus/notes/ -name $jarFile cho "the jar path $jarPath" where jarPath is temporary variable. Can anybody help on this. Thanks in advance ----Sankar (6 Replies)
Discussion started by: sankar reddy
6 Replies

4. Shell Programming and Scripting

Assigning output to a variable

I am new to unix shell scripting. I was trying to convert each lines in a file to upper case. I know how to convert the whole file. But here i have to do line by line. I am getting it in the below mentioned script #!/bin/bash #converting lower to upper in a file #tr "" "" <file1... (3 Replies)
Discussion started by: jpmena
3 Replies

5. Shell Programming and Scripting

Assigning output of a command to variable

When I run time -p <command>, it outputs: real X.XX user X.XX sys X.XXwhere X.XX is seconds. How I can take just that first number output, the seconds of real time, and assign that to a variable? (9 Replies)
Discussion started by: jeriryan87
9 Replies

6. UNIX for Dummies Questions & Answers

assigning (numeric) command output to var tcsh

Hello, I'm trying to assign a numeric value that is returned from one of my programs to a variable in tcsh. I want to do: @ r10 = './my_prog file 35' where ./my_prog file 35 returns a decimal value, but this doesn't work. How do I achieve the desired result? Janet (4 Replies)
Discussion started by: psran
4 Replies

7. Shell Programming and Scripting

Problem with assigning output of grep + awk to a variable

Hi All, I am getting the output for the following command when i run it on the unix console. --------------------------- grep `whoami` /etc/passwd | awk '{print ($1);}' | cut -d ":" -f3 ---------------------------- But i made it into a script and tried to print the variable, its... (5 Replies)
Discussion started by: meheretoknow
5 Replies

8. UNIX for Dummies Questions & Answers

Assigning the output of a command to a variable, where there may be >1 line returned?

Hello I am using unix CLI commands for the Synergy CM software. The command basically searches for a folder ID and returns the names of the projects the folder sits in. The result is assigned to a variable: FIND_USE=`ccm folder -fu -u -f "%name"-"%version" ${FOLDER_ID}` When the command... (6 Replies)
Discussion started by: Glyn_Mo
6 Replies

9. Shell Programming and Scripting

Assigning output from awk to variable

I have a script whose contents are as below result= awk 's=100 END {print s }' echo "The result is" $result The desired output is The result is 100 My script is running without exiting and i am also not getting the desired output. Please help (5 Replies)
Discussion started by: bk_12345
5 Replies

10. Shell Programming and Scripting

Expect - assigning UNIX command output to a variable

Hi, I'm writing a script that connects through ssh (using "expect") and then is supposed to find whether a process on that remote machine is running or not. Here's my code (user, host and password are obviously replaced with real values in actual script): #!/usr/bin/expect set timeout 1... (3 Replies)
Discussion started by: oseri
3 Replies
CATCHOUT(3PVM)							  PVM Version 3.4						    CATCHOUT(3PVM)

NAME
pvm_catchout - Catch output from child tasks. SYNOPSIS
C #include <stdio.h> int info = pvm_catchout( FILE *ff ) Fortran call pvmfcatchout( onoff, info ) PARAMETERS
ff File descriptor on which to write collected output. onoff Integer parameter. Turns output collection on or off. info Integer status code returned by the routine. Values less than zero indicate an error. DESCRIPTION
The routine pvm_catchout causes the calling task (the parent) to catch output from any tasks spawned after the call to pvm_catchout. Char- acters printed on stdout or stderr in children tasks are collected by the pvmds and sent in control messages to the parent task, which tags each line and appends it to the specified file. Output from grandchildren (spawned by children) tasks is also collected, provided the children don't reset their PvmOutputTid. If option PvmShowTids (see pvm_setopt) is true (nonzero), output is printed as shown below, tagged with the task id where the output origi- nated: [txxxxx] BEGIN [txxxxx] (text from child task) [txxxxx] END The output from each task includes one BEGIN line and one END line, with whatever the task prints in between. If PvmShowTids is false, raw output is printed with no additional information. In C, the output file descriptor may be specified. Giving a null pointer turns output collection off for any subsequently spawned child tasks. (Any existing output collection will still proceed at the child tasks, until they exit or change theirPvmOutputTid or related set- tings - see man page for pvm_setopt().) In Fortran, output collection can only be turned on or off (again only for subsequently spawned child tasks), and is always logged to the stdout of the parent task. If pvm_exit is called while output collection is in effect, it will block in order to print all the output, until all tasks sending the given task output have exited. To avoid this, output collection can be turned off by calling pvm_catchout(0) before calling pvm_exit. pvm_catchout() always returns 0. EXAMPLES
C: #include <stdio.h> pvm_catchout(stdout); Fortran: CALL PVMFCATCHOUT( 1, INFO ) SEE ALSO
pvm_exit(3PVM), pvm_setopt(3PVM), pvm_spawn(3PVM) 13 July, 1994 CATCHOUT(3PVM)
All times are GMT -4. The time now is 11:23 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy