Sponsored Content
Top Forums Shell Programming and Scripting Getting the first word using sed,awk or perl Post 302447198 by cola on Saturday 21st of August 2010 08:21:19 PM
Old 08-21-2010
Getting the first word using sed,awk or perl

Input:
Code:
root:x:0:
daemon:x:1:
bin:x:2:
sys:x:3:
adm:x:4:
tty:x:5:
disk:x:6:
lp:x:7:
mail:x:8:

Output:
Code:
root
daemon
bin
sys
adm
tty
disk
lp
mail

 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Sed or awk cut all lines after word

Hi, sorry for newbie question :confused: can't find how to cut ? from 1000 2000 word some text1.... 100 200 300 word some text2.... 10 20 30 abc word some text3.... to some text1.... some text2.... some text3.... (7 Replies)
Discussion started by: Trump
7 Replies

2. Shell Programming and Scripting

Ignore first word using sed in PERL

Please help me in ignoring first word in a line example Input log 123^Babd^Basdf789^B098^Bouiou Desired output abd,asdf789,098,ouiou 123 should be ignored is this possible using sed regular expressions Use code tags - you got a PM with a guide. (2 Replies)
Discussion started by: thankful123
2 Replies

3. Shell Programming and Scripting

awk or sed command to print specific string between word and blank space

My source is on each line 98.194.245.255 - - "GET /disp0201.php?poc=4060&roc=1&ps=R&ooc=13&mjv=6&mov=5&rel=5&bod=155&oxi=2&omj=5&ozn=1&dav=20&cd=&daz=&drc=&mo=&sid=&lang=EN&loc=JPN HTTP/1.1" 302 - "-" "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; Trident/4.0; .NET CLR 1.0.3705; .NET CLR... (5 Replies)
Discussion started by: elamurugu
5 Replies

4. Shell Programming and Scripting

sed or awk to print 2nd last word

Hi, I have a file which has the following /usr/new/xyz/abc /us1/neb/yxr/def /usr/bin/cloud1/fgh /net/bin1/txt1/kdq I want to do something like this /usr/new/xyz/abc xyz /us1/neb/yxr/def yxr /usr/bin/cloud1/fgh cloud1 /net/bin1/txt1/kdq txt1 I need to add the 2nd last word to the... (3 Replies)
Discussion started by: matbrow
3 Replies

5. Shell Programming and Scripting

making the first character of word using uppercase using awk and sed

I want to make the first character of some words to be uppercase. I have a file like the one below. uid,givenname,sn,cn,mail,telephonenumber mattj,matt,johnson,matt johnson,mattj@gmail.com markv,mark,vennet,matt s vennet,markv@gmail.com mikea,mike,austi,mike austin,mike@gmail.com I want... (3 Replies)
Discussion started by: matt12
3 Replies

6. Shell Programming and Scripting

Extract word from text (sed,awk, etc...)

Hello, I need some help extracting the number after the RBA e.g 15911688 from the below block of text (e.g: grep RBA |sed .......). The code should be valid for blocks if text generated at different times as well and not for the below text only. ... (2 Replies)
Discussion started by: drbiloukos
2 Replies

7. Shell Programming and Scripting

sed / awk to get specific word in line

I have http log that I want to get words after specific "tag", this a sample line from the log: 98,POST,200 OK,www.facebook.com,Mozilla/5.0 (Windows NT 6.1; WOW64; rv:9.0.1) Gecko/20100101 Firefox/9.0.1,/ajax/updatestatus.php?__a=1,datr=P_H1TgjTczCHxiGwdIF5tvpC; lu=Si1fMkcrU2SInpY8tk_7tAnw;... (6 Replies)
Discussion started by: erlanq
6 Replies

8. Shell Programming and Scripting

perl lwp find word and print next word :)

hi all, I'm new there, I'm just playing with perl and lwp and I just successfully created a script for log in to a web site with post. I have a response but I would like to have something like this: I have in my response lines like: <div class="sender">mimi020</div> <some html code.....>... (3 Replies)
Discussion started by: vogueestylee
3 Replies

9. Shell Programming and Scripting

Retrieve information Text/Word from HTML code using awk/sed

awk/sed newbie here. I have a HTML file and from that file and I would like to retrieve a text word. <font face=arial size=-1><li><a href=/value_for_clients/Tokyo/abc_process.txt>abc</a> NDK Version: 4.0 </li> <font face=arial size=-1><li><a... (6 Replies)
Discussion started by: sk2code
6 Replies

10. Shell Programming and Scripting

Finding a word with awk or sed

Hello, in a AIX system : AIX CDRATE01 2 7 00FAB3114C00 my following commande give the result : LISTE /tmp/RESS **************************************************************** Liste TYPE = XXXXXXX EX = YYYY VER ... (13 Replies)
Discussion started by: sam01
13 Replies
binlog.conf(4)						     Kernel Interfaces Manual						    binlog.conf(4)

NAME
binlog.conf - binlogd configuration file SYNOPSIS
event_code.priority destination Where: Are the numeric codes specified in binlog.h and the binlogd(8) reference page. An aster- isk (*) specifies that all events should be selected. The code dumpfile Specifies the recovery of the kernel binary event log buffer from a crash dump. A severity level cannot be specified. Filters selected events as severe, high, and low. An asterisk (*) specifies that all events should be selected. A local file pathname to a log file, or a remote system hostname for remote logging of events. DESCRIPTION
The /etc/binlog.conf file is a system file that enables you to configure or filter events that are to be logged by the binary error logger, binlogd. The binlogd daemon ignores blank lines and lines that begin with an octothorpe (#). You can specify # as the first character in a line to include comments in the file or to disable an entry. If you want the binlogd daemon to use a configuration file other than the default, specify the file name with the following command: # bin- logd -f config_file Note that EVM subscribes to binlog events by default, and any configuration options you select will affect what events are available to EVM. You can filter and select binlog events using EVM utilities, as described in the EVM(5) reference page. EXAMPLES
The following is a sample /etc/binlog.conf file: # # binlogd configuration file # #format of a line: event_code.priority destination # # where: event_code - see codes in binlog.h and man page, # * = all events # priority - severe, high, low, * = all priorities # destination - local file pathname or remote system # hostname *.* /usr/adm/binary.errlog dumpfile /usr/adm/crash/binlogdumpfile crdlog /usr/adm/binary.crdlog 102.high /usr/adm/disk.errlog FILES
/etc/binlog.conf /etc/binlog.auth - Authorization file for remote logging. /usr/sys/include/dec/binlog/binlog.h - Common components of a binary event log record. RELATED INFORMATION
Commands: /usr/sbin/binlogd(8), EVM(5) System Administration delim off binlog.conf(4)
All times are GMT -4. The time now is 02:24 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy