Hi,
How do I parse/split lines (strings) read from a file and display the individual tokens in a shell script? Given that the length of individual lines is not constant and number of tokens in each line is also not constant.
The input file could be as below:
... (3 Replies)
anybody know a nice way to parse long input parameters such as --path /dir1/dir2/ (see below). Now I have more than 10 input parameters and it's confusing having parameters like -q something, I would prefer longer ones
case $OPTKEY in
--path) M_PATH=$OPTARG ;;
-s) ... (3 Replies)
hi guys,
i want to parse a file using public function, the file contain raw data in the below format i want to get the output like this to load it to Oracle DB
MARWA1,BSS:26,1,3,0,0,0,0,0.00,22,22,22.00
MARWA2,BSS:26,1,3,0,0,0,0,0.00,22,22,22.00
this the file raw format:
Number of... (6 Replies)
Hi guys (and gals).
I need some help. I'm running an IVR purely on Asterisk where I capture the DTMFs. After pulsing each DTMF I have Asterisk write to a file with whatever was dialed (mostly used for record-keeping) and at the end of the survey I write all variables in a single line to a... (2 Replies)
I would create a bash script than parse like this:
test.sh -p (protocol) -i (address) -d (directory)
I need retrive the value after -p for example...
understand???
I hope...
thanks (6 Replies)
I need help parsing the output of find into an array. I need to search 3 directories and find all files older than 31 days old. This is what I have so far.
TIME=" -maxdepth 1 -mtime +31"
DIR1="/dir1/"
DIR2="/dir2/"
DIR3="/dir3/"
FIND_DIR1=$(find ${DIR1}${TIME})
FIND_DIR3=$(find... (8 Replies)
Hi Experts,
I am trying to parse the following file;
FILEA
a|b|c|c|c|c
a|b|d|d|d|d
e|f|a|a|a|a
e|f|b|b|b|boutput expected:
a<TAB>b
<TAB><TAB>c<TAB>c<TAB>c<TAB>c<TAB>
<TAB><TAB>d<TAB>d<TAB>d<TAB>d<TAB>
e<TAB>f
<TAB><TAB>a<TAB>a<TAB>a<TAB>a<TAB>
<TAB><TAB>b<TAB>b<TAB>b<TAB>b<TAB>*... (7 Replies)
I have two files that I am going to use diff to find the differences but need to parse them before I do that. I have include the format of each file1 and file2 with the desired output of each (the first 5 fields in each file). The first file has a "chr" before the # that needs to be removed. I... (1 Reply)
I am trying to allow a user to enter in text and then store that text in a variable $gene to run in an awk command in which those values are used to run some calculations. I am getting syntax errors however, when I try. Thank you :).
The awk runs great if it is a pre-defined file that is used,... (7 Replies)
Discussion started by: cmccabe
7 Replies
LEARN ABOUT OSF1
makedbm
makedbm(8) System Manager's Manual makedbm(8)NAME
makedbm - Makes a Network Information Service (NIS) dbm file
SYNOPSIS
/var/yp/makedbm [-i yp_input_file] [-s yp_secure_name] [-a method] [-o yp_output_name] [-d yp_domain_name] [-m yp_master_name] infile out-
file
/var/yp/makedbm [-u dbmfilename]
OPTIONS
Specifies that NIS maps are to be stored in one of the following formats: btree -- Recommended when creating and maintaining very large
maps. dbm/ndbm -- For backward compatibility. This is the default. hash -- A potentially quicker method for managing small maps. Cre-
ates a special entry with the key yp_input_file. Creates a special entry with the key yp_secure_file. This causes the makedbm command to
write a secure map. The key value ypserver looks for YP_SECURE. Creates a special entry with the key yp_output_name. Creates a special
entry with the key yp_domain_name. Creates a special entry with the key yp_master_name. If no master host name is specified, yp_mas-
ter_name will be set to the local host name. Undoes a dbm file. That is, prints out a dbm file one entry per line, with a single space
separating keys from values.
DESCRIPTION
The makedbm command takes the file specified by the argument infile and converts it to a single file or a pair of files in dbm(3),
btree(3), or hash(3) format. The dbm(3) files are stored as outfile.pag and outfile.dir. The btree(3) files are stored as outfile.btree.
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 defined as the key's associated data. If a line ends with a backslash (), the data for that record is continued onto the next
line. It is left for the Network Information Service (NIS) clients to interpret the number sign (#); makedbm does not treat it as a comment
character. The infile parameter can be a hyphen (-), in which case makedbm reads the standard input.
The makedbm command is meant to be used in generating database files for NIS. The makedbm command generates a special entry with the key
yp_last_modified, which is the date of infile.
RESTRICTIONS
You must use the same database format for each map in a domain. In addition, a server serving multiple NIS domains must use the same data-
base format for all domains.
Although a Tru64 UNIX NIS server that takes advantage of btree files will be able to store very large maps, NIS slave servers that lack
this feature might have a much smaller limit on the number of map entries they can handle. It may not be possible to distribute very large
maps from a Tru64 UNIX NIS master server to a slave server that lacks support for very large maps. NIS clients are not affected by these
enhancements.
EXAMPLES
The following example shows how a combination of commands can be used to make the NIS dbm files passwd.byname.pag and passwd.byname.dir
from the /etc/passwd file. The percent sign (%) signifies the system prompt. % awk 'BEGIN { FS = ":"; OFS = " "; }
{ print $1, $0 }' /etc/passwd > ptmp % makedbm ptmp passwd.byname % rm ptmp
The awk command creates the file ptmp which is in a form usable by makedbm. The makedbm command uses the ptmp file to create the
database files. The rm command removes the ptmp file. The following is an example of the makedb command used with the btree format
database routine to store NIS maps. makedbm -a b ...
SEE ALSO
Commands: yppasswd(1), ypmake(8)
Functions: btree(3), dbm(3), dbopen(3), hash(3), ndbm(3)makedbm(8)