Sponsored Content
Full Discussion: Calling awk fom csh
Top Forums Shell Programming and Scripting Calling awk fom csh Post 302463901 by kristinu on Monday 18th of October 2010 07:02:56 PM
Old 10-18-2010
Calling awk fom csh

I have to call two awk scripts where the second one used the output from the first one. Am wondering if it may happen that the second awk might start before the first awk finished creating the file...

Code:
  if ($nAnomaly == 1) then
      awk -v anomaly=$Anom -v zloc="$zmin/$zmax" -v dz=$dz  \
          -v cols="neat" -v maxdepth=$maxdepth              \
          -f ../Scripts/create-anomaly-zc.awk $fref.zc > $fmod.zc
  else if ($nAnomaly == 2) then
      awk -v anomaly="$nAnom/$pAnom" -v zloc="$zmin/$ztran/$zmax"  \
          -v dz=$dz -v cols="neat" -v maxdepth=$maxdepth           \
          -f ../Scripts/create-anomaly-zc.awk $fref.zc > $fmod.zc
  endif

  awk -v xi="$xix/$xiz" -v xf="$xfx/$xfz"  \
      -f ../Scripts/convert-zc-cmod.awk $fmod.zc > $fmod.cmod

 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Calling C from within a csh script

After I compile a C program, when I run it from a C shell script, it does not print out the results. e.g: myCFile.c: main(){printf("Hey");} myCshScript: myCFile This does not output "Hey" to the terminal window. I am not even sure if it is executed or not. What should I do to see the... (2 Replies)
Discussion started by: barisgultekin
2 Replies

2. UNIX for Dummies Questions & Answers

Migrating fom windows to UNIX/Linux

Does anyone have any links where i can find informaton about migrating from windows to unix/linux? Itīs both servers and clients that is on discussion. /Henke (2 Replies)
Discussion started by: henke
2 Replies

3. Shell Programming and Scripting

How to plot graph using AWK or CSH?

Hi , i need to plot a x-y axis graph using AWK or CSH. Pls help. The data is as follows: 1 3 2 1 3 4 4 2 5 4 where 1st column refers to x-coordinate and 2nd column refers to y-coordinate. Note that x-coordinate may not be in sequence and the no of set of coordinates is unknown... (3 Replies)
Discussion started by: Raynon
3 Replies

4. Shell Programming and Scripting

how to call awk in a csh Program

Hi Friends, Could you pleas help me out.. I have an awk program which works fine while running it in the command prompt. The awk program is =============== awk 'BEGIN { format="head -%d M2_Sales_N01.txt |tail -%d >M2_Sales_N01_%02d.txt\n" n=0 m=0 } { if (n==0) { tmp=$1 n=1 }... (5 Replies)
Discussion started by: bikas_jena
5 Replies

5. Shell Programming and Scripting

AWK in CSH script problems

Hello Guys, I was trying to obtain the information from the /etc/passwd file, here was my script: 38 echo -n "What's your login name? " 39 set logname=$< 40 echo "Your login name is $logname, your user's ID is `grep $logname /etc/passwd|awk -F: '{print $3}'`" 41 echo " Your home dir is... (1 Reply)
Discussion started by: tpltp
1 Replies

6. Shell Programming and Scripting

calling csh script from ksh shell

hi, I have a csh script, which has setenv X xyz etc My shell is korn Is there some way I can "source" this to have the variables in my current korn shell? thanks (3 Replies)
Discussion started by: JamesByars
3 Replies

7. UNIX for Dummies Questions & Answers

move a variable value from csh to awk ...

Guys, following is my issue: ------------------------ #!/bin/csh # specify a counter @ k = 1 # loop while ($k < 3) # read all text file with a specific number less than 3 in the last column of a record foreach file ( *.txt) # capture the line by passing the column... (1 Reply)
Discussion started by: znbhatti
1 Replies

8. Shell Programming and Scripting

Calling awk from csh

I am trying to call awk from a csh script using awk '{print $1, -$2, $3}' $fvmod.vel > $fvmod.xzv and getting awk: Command not found. Running awk '{print $1, -$2, $3}' $fvmod.vel > $fvmod.xzv on the command line with the actual filenames works (2 Replies)
Discussion started by: kristinu
2 Replies

9. Shell Programming and Scripting

Csh variable calling problem

First post on here. So I use csh shells for my research (physics... not a CS person). I am trying to rerun the same scripts, but there are ~10 files that have similar variables that I have to change for each different configuration, so I would like one central file for the variables I change that... (3 Replies)
Discussion started by: sabrepride
3 Replies

10. Shell Programming and Scripting

awk execution problem in csh

This has no error awk '($8==150) && ($4>=11.001 && $4 <= 12) && ($5>=91.001 && $5<=92){print}' OFS="\t" file following are unable to run in csh this is giving error awk: line 1: syntax error at or near not even working in terminal awk '($'$gr'=='$grn') && ($'$ll'>='$Y' && $'$ll' <= '$Ym')... (1 Reply)
Discussion started by: nex_asp
1 Replies
IGAWK(1)							 Utility Commands							  IGAWK(1)

NAME
igawk - gawk with include files SYNOPSIS
igawk [ all gawk options ] -f program-file [ -- ] file ... igawk [ all gawk options ] [ -- ] program-text file ... DESCRIPTION
Igawk is a simple shell script that adds the ability to have ``include files'' to gawk(1). AWK programs for igawk are the same as for gawk, except that, in addition, you may have lines like @include getopt.awk in your program to include the file getopt.awk from either the current directory or one of the other directories in the search path. OPTIONS
See gawk(1) for a full description of the AWK language and the options that gawk supports. EXAMPLES
cat << EOF > test.awk @include getopt.awk BEGIN { while (getopt(ARGC, ARGV, "am:q") != -1) ... } EOF igawk -f test.awk SEE ALSO
gawk(1) Effective AWK Programming, Edition 1.0, published by the Free Software Foundation, 1995. AUTHOR
Arnold Robbins (arnold@skeeve.com). Free Software Foundation Nov 3 1999 IGAWK(1)
All times are GMT -4. The time now is 08:43 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy