Assuming you have a modern awk (nawk on Sun) this should work. I've added some 'fluff' to illustrate how to capture the command line parameters and use them in your script (don't mean to imply that you don't know how, but thought it made for a more complete example).
CAUTION: I've not tested this.
Since you only use the variable key to construct keysite, you could eliminate the first assignment and just code this:
Hope this helps get you started.
Hey Guys
from the below script what I understood is we are sending the the first parameter as input to the main (){} file
main > $LOGFILE 2>&1
but can we send two or three parameter as input to this main file as
main > $LOGFILE 2>&1 2>&2 like this
Can any one plz help I need to writ a... (0 Replies)
I have an awk file where I need to pass a filename and a value as a parameter from a sh script. I need to know how to pass those values in the sh script and how to use the same in the awk file.
Thanks in advance!!!
Geetha (3 Replies)
Hi,
I am trying to write a script like this:
#!/bin/ksh
#script name: msgflow
#The awk commands for Solaris and Linux are incompatible
if ]
then
msgflow-solaris $*
elif ]
then
msgflow-linux $*
fi
This script is shared by a file system which is visible to both... (3 Replies)
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)
Hi,
I basically have 2 shell scripts.
One is a shell script will get the variable value from the user. The variable is nothing but the IP of the remote system.
Another shell script is a script that does the job of connecting to the remote system using ssh. This uses a expect utility in turn.
... (2 Replies)
Why does this work
for myfile in `find . -name "R*VER" -mtime +1`
do
SHELLVAR=`grep ^err $myfile || echo "No error"`
ECHO $SHELLVAR
done
and outputs
No error
err ->BIST Login Fail 3922 err
No error
err ->IR Remote Key 1 3310 err
But... (2 Replies)
Hi I have a batch file aaa.exe which needs two input parameters:
Usually the command's format likes
aaa 555 10000
But I want to use parameters to do it.
aaa $1 $2
These two parameters come from a text file list.txt
41800497 41801375
41814783 41816135
41814930 41816135
41819987 41820843... (4 Replies)
but the man page seems to not have that feature. Am I missing something?
This works:
$ foo.sh bar abcThis doesn't:
$ at now -f foo.sh bar abcTIA,
Ron (2 Replies)
There's a JavaScript file that I call from command line (there's a framework) like so:
./RunDiag.js param1:'string one here' param2:'string two here'
I have a shell script where I invoke the above command. I can run it in a script as simple as this
#!/bin/bash
stuff="./RunDiag.js... (4 Replies)
I need to pass values at runtime for the below awk command where
l is the length and partial.txt is the file name.
awk -v l=285 '{s="%-"l"s\n";printf(s,$0);}' partial.txt > temp1.txt; (5 Replies)
Discussion started by: Amrutha24
5 Replies
LEARN ABOUT MOJAVE
makedbm
makedbm(1M) System Administration Commands makedbm(1M)NAME
makedbm - make a dbm file, or get a text file from a dbm file
SYNOPSIS
makedbm [-b] [-l] [-s] [-E] [-i yp_input_file] [-o yp_output_name] [-d yp_domain_name] [-m yp_master_name] [-S delimiter] [-D num-
ber_of_delimiters] infile outfile
makedbm [-u dbmfilename]
DESCRIPTION
The makedbm utility takes the infile and converts it to a pair of files in ndbm format (see ndbm(3C)), namely outfile.pag and outfile.dir.
Each line of the input file is converted to a single dbm record. All characters up to the first TAB or SPACE form the key, and the rest of
the line is the data. If a line ends with `' (backslash), the data for that record is continued on to the next line. makedbm does not
treat `#' (pound-sign) as a special character.
Because makedbm is mainly used in generating dbm files for the NIS name service, it generates a special entry with the key yp_last_modi-
fied, which is the date of infile (or the current time, if infile is `-'). The entries that have keys with the prefix yp_ are interpreted
by NIS server utilities.
OPTIONS
The following options are supported:
-b Insert the YP_INTERDOMAIN into the output. This key causes ypserv(1M) to use DNS for host name and address
lookups for hosts not found in the maps.
-d yp_domain_name Create a special entry with the key yp_domain_name.
-D number_of delimiters Specify number_of_delimiters to skip before forming the key.
-E Delimiters are escaped.
-i yp_input_file Create a special entry with the key yp_input_file.
-l Lower case. Convert the keys of the given map to lower case, so that, for example, host name matches succeed inde-
pendent of upper or lower case distinctions.
-m yp_master_name Create a special entry with the key yp_master_name. If no master host name is specified, yp_master_name is set to
the local host name.
-o yp_output_name Create a special entry with the key yp_output_name.
-s Secure map. Accept connections from secure NIS networks only.
-S delimiter Specify the delimiter to use instead of the default delimiter for forming the key.
-u dbmfilename Undo a dbm file. Prints out the file in text format, one entry per line, with a single space separating keys from
values.
OPERANDS
The following operands are supported:
infile Input file for makedbm. If infile is `-' (dash), the standard input is read.
outfile One of two output files in ndbm format: outfile.pag and outfile.dir.
ATTRIBUTES
See attributes(5) for descriptions of the following attributes:
+-----------------------------+-----------------------------+
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
+-----------------------------+-----------------------------+
|Availability |SUNWcsu |
+-----------------------------+-----------------------------+
SEE ALSO ypserv(1M), ndbm(3C), attributes(5)SunOS 5.10 17 Aug 1999 makedbm(1M)