Actually I got a list of file end with *.txt
I want to use the same command apply to all the *.txt
Thus I try to find out the fastest way to write those same command in a script and then want to let them run automatics.
For example:
I got the file below:
file1.txt
file2.txt
file3.txt... (4 Replies)
Hi Experts,
I am adding a column of numbers with awk , however not getting correct output:
# awk '{sum+=$1} END {print sum}' datafile
2.15291e+06
How can I getthe output like : 2152910
Thank you..
# awk '{sum+=$1} END {print sum}' datafile
2.15079e+06 (3 Replies)
Hi
I have many problems with a script. I have a script that formats a text file but always prints the same error when i try to execute it
The code is that:
{
if (NF==17){
print $0
}else{
fields=NF;
all=$0;
while... (2 Replies)
I have two files which I would like to compare and then manipulate in a way.
File1:
pictures.txt 1.1 1.3
dance.txt 1.2 1.4
treehouse.txt 1.3 1.5
File2:
pictures.txt 1.5 ref2313 1.4 ref2345 1.3 ref5432 1.2 ref4244
dance.txt 1.6 ref2342 1.5 ref2352 1.4 ref0695 1.3 ref5738 1.2... (1 Reply)
Hi,
I have a situation to compare one file, say file1.txt with a set of files in directory.The directory contains more than 100 files.
To be more precise, the requirement is to compare the first field of file1.txt with the first field in all the files in the directory.The files in the... (10 Replies)
Hello experts,
I'm stuck with this script for three days now. Here's what i need.
I need to split a large delimited (,) file into 2 files based on the value present in the last field.
Samp: Something.csv
bca,adc,asdf,123,12C
bca,adc,asdf,123,13C
def,adc,asdf,123,12A
I need this split... (6 Replies)
Hi,
I am trying to pass awk field to a command line executed within awk (need to convert a timestamp into formatted date).
All my attempts failed this far.
Here's an example.
It works fine with timestamp hard-codded into the command
echo "1381653229 something" |awk 'BEGIN{cmd="date -d... (4 Replies)
Good evening, Im newbie at unix specially with awk
From an scheduler program called Autosys i want to extract some data reading an inputfile that comprises jobs names, then formating the output to columns for example
1.
This is the inputfile:
$ more MapaRep.txt
ds_extra_nikira_usuarios... (18 Replies)
Discussion started by: alexcol
18 Replies
LEARN ABOUT HPUX
makedbm
makedbm(1M)makedbm(1M)NAME
makedbm - make a Network Information System database
SYNOPSIS
nis_input_file] nis_output_name] nis_domain_name] nis_master_name] infile outfile
database_name
Remarks
The Network Information Service (NIS) was formerly known as Yellow Pages (yp). Although the name has changed, the functionality of the
service remains the same.
DESCRIPTION
generates databases (maps) for the Network Information System (NIS) from infile. A database created by consists of two files: and A data-
base contains records called dbm records composed of key-value pairs.
Each line of infile is converted to a single dbm record; all characters up to the first tab or space form the key, and the remainder of the
line is the value. If a value read from infile ends with the value for that record is continued onto the next line. The NIS clients must
interpret the character (which means that does not treat the as if it precedes a comment). If infile is a hyphen reads standard input.
always generates a special dbm record with the key whose value is the time of last modification of infile (or the current time, if infile
is This value is also known as the order number of a map, and prints it for a specified NIS map (see yppoll(1M)).
Another special dbm record created by has the key Its value is usually the host name retrieved by however, the option can be used to spec-
ify a different value (see gethostname(2)).
If the option is used, another special dbm record with the key is created. When this key exists in the NIS host.by* maps or ipnodes.by*
maps and the NIS host name resolution fails, the process will query the Internet domain name server, to provide the host name resolution.
Before using the option, it is recommended that the name services switch, be set to allow NIS host name resolution first. (Note that,
since the process only checks hosts.by* and ipnodes.by* for the existence of the key, using the option on any other NIS map will have no
effect. Also, the option should be used on both the *.byname and *.byaddr maps, not one exclusively.)
If the option is used, another special dbm record created is the key. If this key exists in an NIS map, will only allow privileged pro-
cesses (applications that can create reserved ports) to access the data within the map.
Options
recognizes the following options and command-line arguments.
Create a special dbm record with the key
This key, which is in the hosts.byname, hosts.byaddr, ipnodes.byname, and ipnodes.byaddr maps, allows the process to query the
Internet domain name server (see named(1M)).
Convert the keys of the given map to lowercase.
This command option allows host name matches to work independent of character-case distinctions.
Accept connections from secure NIS networks only.
Create a special dbm record with the key
and the value If the option is used, another special dbm record created is the key. If this key exists in an NIS map, will only
allow privileged processes to access the data within the map (that is, applications that can create reserved ports).
Create a special dbm record with the key
and the value nis_output_name.
Create a special dbm record with the key
and the value nis_domain_name.
Replace the value of the special dbm record whose key is
with nis_master_name.
Undo the
database_name (that is, write the contents of database_name to the standard output) one dbm record per line. A single space sepa-
rates each key from its value.
EXAMPLES
Shell scripts can be written to convert ASCII files such as to the key-value form used by For example,
#!/usr/bin/sh
/usr/bin/awk 'BEGIN { FS = ":" } { print $1, $0 }'
/etc/netgroup |
makedbm - netgroup
converts the file to a form that is read by to make the NIS map The keys in the database are names, and the values are the remainders of
the lines in the file.
AUTHOR
was developed by Sun Microsystems, Inc.
SEE ALSO domainname(1), named(1M), ypinit(1M), ypmake(1M), yppoll(1M), gethostname(2), netgroup(4), ypfiles(4).
makedbm(1M)