Hi,
When we "grep" for a word in a file, it returns the lines containing the word that we searched for. Is there a way to display only the words and not the entire line containing them.
Thanks
Ananth (6 Replies)
hi, consider the below line in a text file,
'Y',getdate(),'N','V',NULL .....
'N',getdate(),'Y','D',NULL .....
'Y','N','Y',getdate(),'Y','D',NULL ....
as u see above, i want only the second word after the getdate() word...
getdate() will not come 2nd word alwys it may be any position but i... (11 Replies)
ok, so this is proving to be kind of difficult even though it should not be.
say for instance I want to grep out ONLY the word fkafal from the below output, how do I do it?
echo ajfjf fjfjf iafjga fkafal foeref afoafahfia | grep -w "fkafal"
If i run the above command, i get back all the... (4 Replies)
Hi,
I have input file as below. Can you help me?
inac_4y;0;2;Balance;200;1;1;
0;2;Balance;100;1;
0;inac_nq;0;1;Balance;100;1
desired output
Balance;200
Balance;100
Balance;100
-Suresh
Please use and tags when posting code, data or logs etc. to preserve formatting... (5 Replies)
Hi all,
FileOne
family balance >>>>>
0 0
0 0
java.io.FileNotFoundException: Settings.xml (No such file or directory)
at java.io.FileInputStream.open(Native Method)
..
....
.....
.....
java.lang.NullPointerException
...
.....
......
Stacktrace:
at... (2 Replies)
Hi
can we grep for a word and print the next word of the greped word?
ex:- create or replace function function_name
create function function_name
we should search for word "function" and output next word "function_name" from both lines. (3 Replies)
Hi All,
Can Someone help me in capturing a word from xml Using sed or awk or any other way in unix.
i have file abc.xml like this
<?xml version="1.0" encoding="ISO-8859-1" standalone="no" ?>
- <NREC xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
- <HEADER>
<SOURCE>MAIL</SOURCE>... (5 Replies)
Hi,
Below is an example :
ST1 PREF: int1 AVAIL: int2
ST2 PREF :int1 AVAIL: int2
I need int1 to come in preferred variable while programming and int2 in available variable
Please help me doing so
Best regards,
Vishal (10 Replies)
Hi Folks,
Could you please advise what will be the SED command to replace a word in all xml's under a particular directory
for example let say I rite now at the following below location
$ cd /ter/rap/config
now under config directory there will be lots of xml file , now my objective is to... (1 Reply)
I have a file "test" with following contents:
cat test
abc
abcd_efg
abc_abc
I want to only grep for abc or abc_ without getting other results, how do I achieve this?
If I use grep -w abc test option I get only abc and not abc_.
If I use egrep "abc|abc_" test its still printing... (3 Replies)
Discussion started by: ctrld
3 Replies
LEARN ABOUT SUSE
sg_luns
SG_LUNS(8) SG3_UTILS SG_LUNS(8)NAME
sg_luns - send the SCSI REPORT LUNS command
SYNOPSIS
sg_luns [--decode] [--help] [--hex] [--maxlen=LEN] [--quiet] [--raw] [--select=SR] [--verbose] [--version] DEVICE
DESCRIPTION
Send the SCSI REPORT LUNS command to the DEVICE and outputs the response. In the SPC-3 SCSI standard support for this command is mandatory.
OPTIONS
Arguments to long options are mandatory for short options as well.
-d, --decode
decode logical unit numbers into their hierarchical parts. Interprets luns as described in SAM-3 when the HiSup bit is set in a
standard INQUIRY's response.
-h, --help
output the usage message then exit.
-H, --hex
output response to this command in ASCII hex.
-m, --maxlen=LEN
where LEN is the (maximum) response length in bytes. It is placed in the cdb's "allocation length" field. If not given (or LEN is
zero) then 65536 is used. The maximum value of LEN is 65536.
-q, --quiet
output ASCII hex rendering of each report lun, one per line.
-r, --raw
output response in binary (to stdout).
-s, --select=SR
this option sets the 'select report' field (SR) in the SCSI REPORT LUNS command. The default value is 0. When 0 is given (or this
option is not specified) then the DEVICE should yield a list of luns addressable via this "I_T nexus" that use the following lun
addressing methods: logical unit addressing, peripheral device addressing and flat space addressing. When 1 is given the DEVICE
should yield a list of only "well known" logical units addressable via this "I_T" nexus. When 2 is given the DEVICE should yield all
luns addressable via this "I_T" nexus. To simplify, for the I_T nexus associated with the DEVICE, the meanings of the SR values
are:
0 : all luns excluding well known logical units
1 : well known logical units
2 : all luns
Values greater than 2 are reserved (at SPC-4 (rev 8)).
-v, --verbose
increase the level of verbosity, (i.e. debug output).
-V, --version
print the version string and then exit.
EXIT STATUS
The exit status of sg_luns is 0 when it is successful. Otherwise see the sg3_utils(8) man page.
AUTHORS
Written by Douglas Gilbert.
REPORTING BUGS
Report bugs to <dgilbert at interlog dot com>.
COPYRIGHT
Copyright (C) 2004-2008 Douglas Gilbert
This software is distributed under a FreeBSD license. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PUR-
POSE.
SEE ALSO sg_inq(8)sg3_utils-1.26 April 2008 SG_LUNS(8)