given myFile:
running nawk '{printf("%c%s", ((/^[0-9]+/&&FNR!=1)?ORS:""), $0)}END{print ""}' myFile produces:
Check your myFile input file. Make sure it doesn't contain any ^M-s. Post the output of:
What would be the most succinct way of doing this (preferably in 1 line, maybe 2):
searching the first 10 characters of every line in a text file for a specific string, and if it was found, print out characters 11-20 of the line on which the string was found.
In this case, it's known that there... (13 Replies)
Hi,
I need to find out the last column value from a text file which is delimited by a tab.
The issue here is the last column# for each record can be different i.,e, 1st record can have the last column as 15 and the second record can have the last column as "17".
I have to search a string... (3 Replies)
Can any one tell me how to get the second last column value from the text file, which has different record size for each record.
I know how to get the last column using awk and print statements, but I am unable to get the second last column value from the file. (4 Replies)
Can someone tell me how I can do this?
e.g:
Say file1.txt contains:
today is monday
the 22 of
NOVEMBER
2010
and file2.txt contains:
the
11th
month
of
How do i replace the word NOVEMBER with (5 Replies)
Hi all,
I have an input file like
1,date,company,,
1,date,comapny,,
2,000,,,567,ACT,00,,,,KKG,M1,D45,,67J,+4500000000
2,000,,,567,ACT,00,,,,KKG,M6,D49,,56J,+6000
2,000,,,567,ACT,00,,7,,KKG,M3,D58,,68h,-70000
2,000,,,567,ACT,00,,,,KKG,M9,D95,,34m,0.00
3,total
what i require is
1.I... (2 Replies)
Hello everyone!
As the heading reads, I would like to sort the lines of a text file, starting at a specific column (i.e. skip the first X characters of each line).
What I’m actually trying to sort is the md5 sums file of a directory. Every time I copy a new file to that directory, I perform... (3 Replies)
Hi,
I have a requirement with,
No~Dt~Notes
1~2011/08/1~"aaa
bbb
ccc
ddd
eee
fff
ggg
hhh"
Single column alone got splitted into multiple lines.
I require the output as
No~Dt~Notes
1~2011/08/1~"aaa<>bbb<>ccc<>ddd<>eee<>fff<>ggg<>hhh"
mean to say those new lines to be... (1 Reply)
Hi All,
Can you please guide me to search a string in a particular column of file and return the line number of the line where it was found using awk. As an example :
abc.txt
7000,john,2,1,0,1,6
7001,elen,2,2,0,1,7
7002,sami,2,3,0,1,6
7003,mike,1,4,0,2,1
8001,nike,1,5,0,1,8... (3 Replies)
I would like to add a line to the end of a single column text file. How do I go about doing that?
Input:
BEGIN
1
2
3
Output:
BEGIN
1
2
3
END
Thanks! (1 Reply)
Discussion started by: evelibertine
1 Replies
LEARN ABOUT SUNOS
wanboot_keygen
wanboot_keygen(1M) System Administration Commands wanboot_keygen(1M)NAME
wanboot_keygen - create and display client and server keys for WAN booting
SYNOPSIS
/usr/lib/inet/wanboot/keygen -c -o net=a.b.c.d ,cid=client_ID,type=3des
/usr/lib/inet/wanboot/keygen -c -o net=a.b.c.d ,cid=client_ID,type=aes
/usr/lib/inet/wanboot/keygen -m
/usr/lib/inet/wanboot/keygen -c -o net=a.b.c.d ,cid=client_ID,type=sha1
/usr/lib/inet/wanboot/keygen -d -m
/usr/lib/inet/wanboot/keygen -c -o net=a.b.c.d ,cid=client_ID,type=keytype
DESCRIPTION
The keygen utility has three purposes:
o Using the -c flag, to generate and store per-client 3DES/AES encryption keys, avoiding any DES weak keys.
o Using the -m flag, to generate and store a "master" HMAC SHA-1 key for WAN install, and to derive from the master key per-client HMAC
SHA-1 hashing keys, in a manner described in RFC 3118, Appendix A.
o Using the -d flag along with either the -c or -m flag to indicate the key repository, to display a key of type specified by keytype,
which must be one of 3des, aes, or sha1.
The net and cid arguments are used to identify a specific client. Both arguments are optional. If the cid option is not provided, the key
being created or displayed will have a per-network scope. If the net option is not provided, then the key will have a global scope. Default
net and code values are used to derive an HMAC SHA-1 key if the values are not provided by the user.
OPTIONS
The following options are supported:
-c
Generate and store per-client 3DES/AES encryption keys, avoiding any DES weak keys. Also generates and stores per-client HMAC SHA-1
keys. Used in conjunction with -o.
-d
Display a key of type specified by keytype, which must be one of 3des, aes, or sha1. Use -d with -m or with -c and -o.
-m
Generate and store a "master" HMAC SHA-1 key for WAN install.
-o
Specifies the WANboot client and/or keytype.
EXAMPLES
Example 1: Generate a Master HMAC SHA-1 Key
# keygen -m
Example 2: Generate and Then Display a Client-Specific Master HMAC SHA-1 Key
# keygen -c -o net=172.16.174.0,cid=010003BA0E6A36,type=sha1
# keygen -d -c -o net=172.16.174.0,cid=010003BA0E6A36,type=sha1
Example 3: Generate and Display a 3DES Key with a Per-Network Scope
# keygen -c -o net=172.16.174.0,type=3des
# keygen -d -o net=172.16.174.0,type=3des
EXIT STATUS
0
Successful operation.
>0
An error occurred.
ATTRIBUTES
See attributes(5) for descriptions of the following attributes:
+-----------------------------+-----------------------------+
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
+-----------------------------+-----------------------------+
|Availability |SUNWwbsup |
+-----------------------------+-----------------------------+
|Interface Stability |Obsolete |
+-----------------------------+-----------------------------+
SEE ALSO attributes(5)SunOS 5.10 18 Apr 2003 wanboot_keygen(1M)