02-06-2008
small problem
One more problem,
Radoulov- I'm using the your below code:
nawk 'f[FILENAME]==1&&!/^\*TM\*/;/^\*TM\*/{f[FILENAME]++}' $(<list_file) > complete.txt
Since datafile and list will not be in the same location. Also list file will only have the datafile names to be selected and not the location. We've to declare this explicitly.
ex: FTPIN/ is the location for datafile and FILES/ is the location for list file and FTPOUT/ is the location for complete.txt file.
I've to mention these location in your code as below:
nawk 'f[FILENAME]==1&&!/^\*TM\*/;/^\*TM\*/{f[FILENAME]++}' $(<FILES/list_file) >> FTPOUT/complete.txt
But where to mention the datafile location FTPIN/ to select the datafiles?
Also please correct me if Iam wrong for the above code.
10 More Discussions You Might Find Interesting
1. UNIX for Advanced & Expert Users
I have an awk script contained within a ksh script that I want to read the contents of a file with, say 3 records. Fields are a, b, and c, delimiter '|'.
I want to read the file and then I want to set different variables for $1, $2, $3 to be used as parameters to run a series of reports outside... (2 Replies)
Discussion started by: giannicello
2 Replies
2. Shell Programming and Scripting
suppose my one file has
>1|lol|hai i am cdfd
dafvshbejndjnudbnjdbyebjcb
bdhbdjndjndmdkmdkldhddjndj
dbdhbndjndjmdklm
sjskndknsknsknks
sbsjksnknsknknklsl
>2|lol|hai ia m cdfd123
jbsjbjbjbjbjbjbjbjbjbj
jkbkkkkkkkkkkkkk
khkkkkkkkkkkkkk
scbjbjbakbqlblabkla
>3lol|hai ia m cdfd3435... (2 Replies)
Discussion started by: cdfd123
2 Replies
3. Shell Programming and Scripting
Hi guys
I have a shell script that executes sql statemets and sends the output to a file.the script takes in parameters executes sql and sends the result to an output file.
#!/bin/sh
echo " $2 $3 $4 $5 $6 $7
isql -w400 -U$2 -S$5 -P$3 << xxx
use $4
go
print"**Changes to the table... (0 Replies)
Discussion started by: magikminox
0 Replies
4. Shell Programming and Scripting
Hello,
I have this awk script that I want to execute by passing parameters through a shell script.
I'm a little confused. This awk script removes duplicates from an input file.
Ok, so I have a .sh file called rem_dups.sh
#!/usr/bin/sh... (4 Replies)
Discussion started by: script_op2a
4 Replies
5. Shell Programming and Scripting
hi everyone
i am trying to do this
bash> cat abc.sh
deepak()
{
echo Deepak
}
deepak
bash>./abc.sh
Deepak
so it is giving me write simply i created a func and it worked
now i modified it like this way
bash> cat abc.sh (2 Replies)
Discussion started by: aishsimplesweet
2 Replies
6. Shell Programming and Scripting
I am getting the following error while passing parameter to a shell script called within awk script. Any idea what's causing this issue and how to ix it ? Thanks
sh: -c: line 0: syntax error near unexpected token `newline'
sh: -c: line 0: `./billdatecalc.sh ... (10 Replies)
Discussion started by: Sudhakar333
10 Replies
7. Post Here to Contact Site Administrators and Moderators
Variable I have in my shell script
diff=$1$2.diff
id=$2
new=new_$diff
echo "My id is $1"
echo "I want to sync for user account $id"
##awk command I am using is as below
cat $diff | awk -F'~' ''$2 == "$id"' {print $0}' > $new
I could see value of $id is not passing to the awk... (0 Replies)
Discussion started by: Ashunayak
0 Replies
8. Shell Programming and Scripting
I have a shell script (.sh) and I want to pass a parameter value to the awk command but I am getting exception, please assist.
diff=$1$2.diff
id=$2 new=new_$diff
echo "My id is $1"
echo "I want to sync for user account $id"
##awk command I am using is as below
cat $diff | awk... (2 Replies)
Discussion started by: Ashunayak
2 Replies
9. UNIX for Dummies Questions & Answers
I have a shell script (.sh) and I want to pass a parameter value to the awk command but I am getting exception, please assist.
diff=$1$2.diff
id=$2 new=new_$diff
echo "My id is $1"
echo "I want to sync for user account $id"
##awk command I am using is as below
cat $diff |... (1 Reply)
Discussion started by: Sarita Behera
1 Replies
10. UNIX for Beginners Questions & Answers
I'm trying to create a shell script that takes a awk script that I wrote and a filename as an argument. I was able to get that done but I'm having trouble figuring out how to keep the header of the output at the top but sort the rest of the rows alphabetically. This is what I have now but it is... (1 Reply)
Discussion started by: Eric7giants
1 Replies
Xmark(1) General Commands Manual Xmark(1)
NAME
Xmark - summarize x11perf results
SYNTAX
Xmark datafile
DESCRIPTION
Xmark is a shell script that reads the indicated datafile and compiles a benchmark which it writes to standard output. It writes three
numbers:
A weighted performance number for the x11perf results.
A weighted performance number for a standard SparcStation 1, with SunOS 4.1.2, X11R5 Xsun, and a CG3 dumb Color Frame Buffer.
The Xmark, which is the ratio of the two numbers above.
The datafile must be an ordinary file, produced by x11perf in the following way:
x11perf -display display -v1.3 -rop GXcopy GXxor -all > datafile
It is possible to run the GXcopy and GXxor tests separately, as long as they are concatenated to the same output file:
x11perf -display display -v1.3 -rop GXcopy -all > datafile
x11perf -display display -v1.3 -rop GXxor -all >> datafile
or
x11perf -display display -v1.3 -rop GXxor -all > datafile
x11perf -display display -v1.3 -rop GXcopy -all >> datafile
FILES
temp.$$
Temporary file created in the current directory, deleted after use.
DIAGNOSTICS
Usage: Xmark datafile
Xmark was invoked without arguments or with more than one argument, or with options. Xmark takes no options.
Error: data file does not exist or is not ordinary.
Xmark cannot find the datafile named on its command line, or the datafile is a special file such as a directory.
WARNING: datafile contains nnn, not 441 or 447 'trep' results;
The file named on the command line does not seem to be a file generated by x11perf in the expected way.
Diagnostic: ERROR: sum of weights =nnn, not equal to 4566.0;
There is an internal error in Xmark.
SEE ALSO
X(7x), x11perf(1), x11perfcomp(1)
X Version 11 Release 6.6 Xmark(1)