I was trying to obtain the information from the /etc/passwd file, here was my script:
But I can't get the right answer. The result is as follows:
It seems that in the awk segment, the shell replaces inner awk's parameters $N with the shell script's variables.
I am trying to set a command into a variable in a csh script using command substituion with ``. I am having a problem with ps command combined with grep. The command is as follows (shows processes running with the word gpts in them).
/usr/ucb/ps axwww | grep gpts
this works fine at the... (2 Replies)
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)
I have an extraordinary problem with a csh script.....(feel free to berate the use of this but I'm modifying an existing bunch of them)
Anyway, I have a master csh script which in turn calls a second csh script. This second csh script is below. Within this second script are two compiled C++... (1 Reply)
Hi all,
I want to use some commands and I wrap them into an array, like follows:
set ALIAS_AR = ( "ls -ltr|wc -l" \
"ps -ef|grep -v grep |grep tty|wc -l" \
"who|wc -l" )
Then I use a while loop to call every step:
set no = 1... (3 Replies)
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)
Hey,
I've gone through the code a number of times but I can't get the result that I want.
If I run it on some big old maillogs then it basically doesn't give the right output.
The script:
#!/bin/awk -f
BEGIN { delivery_count = 0; deferred_mail_count = 0; deliveries_failed =... (5 Replies)
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)
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...
if ($nAnomaly == 1) then
awk -v anomaly=$Anom -v zloc="$zmin/$zmax" -v dz=$dz \
... (1 Reply)
Hello dear users, here I have a script to manipulate .csv files that are like this originally:
And I need to make a script to delete certain fields. Each field is separated with a comma.
So, here is my script (at least a part of it):
Field $1 is composed of a name, and then a... (5 Replies)
I have the following script set up and working properly in bash. It basically copies a set of lines which match "AS1100002" from one file and replaces the same lines in another file.
awk -vN=AS1100002* 'NR==FNR { if($1 ~ N)K=$0; next }
{ if($1 in K) $0=K; print }' $datadir/file1... (7 Replies)