sorry I dont have the use of nawk or grep with the -q switch
egrep -v wouldn't get what Im looking for as it wouldnt highlight any errors
sorry I only have limited knowledge of awk and sed so Im not sure how I would use them in this case
What I am looking for is by using grep or egrep or any other command to search though a file for expression1|expression2|expression3 etc... and if it can't find one of the expressions output an error along the lines of "can't find expression1". If it does find the expression in the file then do nothing and output nothing.
Thankyou for all your help so far people
---------- Post updated at 04:05 AM ---------- Previous update was at 04:01 AM ----------
Hi all,
I have an input file that I am pulling out certain phases using the following commands:
cat /nodes.txt | egrep -e 'OSVersion|PrimaryNodeName'
Currently the output looks like this:
OSVersion - 5.0
PrimaryNodeName - serverA
OSVersion - 5.0
PrimaryNodeName - serverB
OSVersion... (2 Replies)
Hi,
I want to return failure from my script if a string is NOT found in a file, but I can't work out how to negate my "if". At the moment I have :
if (egrep -i 'search string' filetosearch); then
echo "found"
else
return 2
fi
How can I get rid of the echo bit and just test for "string... (4 Replies)
Dear Friends,
I have a command which can result following output.
Packet is: /var/adm/yyyy/pkt6043
Intended for network : /vob/repo
I would like to retrive
pkt6043 and /vob/repo using single command.
Blue color test will be always contstant and red color text will be dynamic
... (2 Replies)
I have the following script that searches in several files and shows the search results and the matches filename on the screen.
find . -exec egrep -wH "word1|word2" {} \;
the output from the search display as:
file1
word1
word2
I need to show each file search output result on new... (5 Replies)
Attached is the exact ouput of a vmware VDR log file I am working with but what I am trying to achieve is as follows:
I need to output sections of the file using the string "Normal backup" as the start and "Duration" as the end to seperate files so I can then manipulate them further to create... (2 Replies)
Hi,
I am newbie in shell programming and I need some help.
I had some data and I format it in a file like
dn: uid=aaaaa, dc=exmple, dc=com
cn: bbbb cccc
sn: cccc
telephoneNumber:+30-6543-123456
I have to extract the information aaaaa , bbbb, cccc and the phone number
using awk... (3 Replies)
Hello all,
after spending hours of searching the web I decided to create an account here. This is my first post and I hope one of the experts can help.
I need to resolve a grep / sed / xargs / awk problem.
My input file is just like this:
----------------------------------... (6 Replies)
The order of egrep output seems to be as they occur in the file. How do I get the order as requested? For e.g.
file contents:
AAA
EEE
GGG
egrep 'GGG|AAA|EEE' file
gives
AAA
EEE
GGG
instead of
GGG
AAA
EEE (2 Replies)
If I have an output from egrep that has two elements on separate lines can I concatenate them? so the egrep for examople might be:
egrep "filename|type"
And the actual output might be:
./file001.doc
Type Text Document
How do I get the egrep to remove the line feed so the output is:
... (5 Replies)
Dear community,
I am trying for several hours now to create an egrep command to grep the number of lines containing a specific text from a text-file but seem to have an error somewhere.
The Textfile contains several thousand lines and has the expression "Lastname" in several lines.... (3 Replies)
Discussion started by: Donzo
3 Replies
LEARN ABOUT HPUX
lvrmboot
lvrmboot(1M)lvrmboot(1M)NAME
lvrmboot - remove LVM logical volume link to root, primary swap, or dump volume
SYNOPSIS
autobackup] dump_lv] vg_name
Remarks
cannot be performed if the volume group is activated in shared mode.
DESCRIPTION
This command is supported for arguments belonging to volume groups version 1.0. Attempting this command with arguments belong to volume
groups version 2.0 or higher will result in an error.
The command updates all physical volumes contained in the volume group vg_name such that the logical volume is removed as a root, primary
swap, or dump volume when the system is next booted on the volume group.
Options and Arguments
recognizes the following options and arguments:
vg_name The path name of the volume group.
Set automatic backup for this invocation of this command.
autobackup can have one of the following values:
Automatically back up configuration changes made to the logical volume.
This is the default.
After this command executes, the command (see vgcfgbackup(1M)) is executed for the volume group to which
the logical volume belongs.
Do not back up configuration changes this time.
Remove the definition of
dump_lv as one of the dump volumes. Update the Boot Data Reserved Area.
This option will be obsolete in the next HP-UX release.
Remove the definitions of all of the root, primary swap,
and all dump volumes from the given volume group. Update the Boot Data Reserved Area.
Remove the definition of the primary swap volume
from the given volume group. Update the Boot Data Reserved Area.
This option will be obsolete in the next HP-UX release.
Print verbose messages.
EXTERNAL INFLUENCES
Environment Variables
determines the language in which messages are displayed.
If is not specified or is null, it defaults to "C" (see lang(5)).
If any internationalization variable contains an invalid setting, all internationalization variables default to "C" (see environ(5)).
EXAMPLES
Specify that the logical volume should be removed as one of the dump logical volumes:
Specify that volume group should no longer be a root volume group. Primary swap and dump are also removed.
SEE ALSO lvlnboot(1M), lvmadm(1M).
lvrmboot(1M)