08-18-2008
cat/delete per line any word "192.168.1.12"
Hi All
Can u help me..
My problem is delete word per line
sample:
cat /tmp/file.txt
monitor 192.168.1.11 Copying files in current directory 1
monitor 192.168.1.1 Copying files in current directory 2
monitor 192.168.1.12 Copying files in current directory 3
monitor 192.168.1.14 Copying files in current directory 4
monitor 192.168.1.15 Copying files in current directory 5
monitor 192.168.1.12 Copying files in current directory 6
monitor 192.168.1.166 Copying files in current directory 7
monitor 192.168.1.12 Copying files in current directory 8
monitor 192.168.1.112 Copying files in current directory 9
so what is command for cat/delete per line any word "192.168.1.12" in file /tmp/file.txt
Thx.
car
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
Hi Friends,
Can any of you explain me about the below line of code?
mn_code=`env|grep "..mn"|awk -F"=" '{print $2}'`
Im not able to understand, what exactly it is doing :confused:
Any help would be useful for me.
Lokesha (4 Replies)
Discussion started by: Lokesha
4 Replies
2. HP-UX
Hi All... I'm newbie here...,
i have problem when installing oracle9206, i use HPUX 11.11,
i'm using Xmanager enterprise 2.1 for forwarding from server A to my laptop
# export DISPLAY=192.168.1.239:0.0
# echo $DISPLAY
output ==> 192.168.1.239:0.0
at the oracle directory, i execute ... (3 Replies)
Discussion started by: grimanda
3 Replies
3. Shell Programming and Scripting
Hello experts,
I know line number of the word I want to replace. Can "sed" substitute word on a specific line?
As well, can sed substitute words inside a specific patten.
ex. <word>lalala</word> #replace anything between <word> and </word>
minifish (2 Replies)
Discussion started by: minifish
2 Replies
4. Shell Programming and Scripting
hi All,
cat file_name | awk /^~/'{print $1","$2","$3","$4}' | sed -e 's/~//g'
Can this be done by using sed or awk alone (4 Replies)
Discussion started by: harshakusam
4 Replies
5. Shell Programming and Scripting
Hi guys.
I am trying to perform a search using grep. I get my grep to work, but need to "awk" a Process Number that is 2 lines above...
Example:
I run a query on my TSM server for Processes that are "Waiting" for something...it returns this:
Process Number: 32,881
Process... (14 Replies)
Discussion started by: Stephan
14 Replies
6. Shell Programming and Scripting
Hi,
I have line in input file as below:
3G_CENTRAL;INDONESIA_(M)_TELKOMSEL;SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL
My expected output for line in the file must be :
"1-Radon1-cMOC_deg"|"LDIndex"|"3G_CENTRAL|INDONESIA_(M)_TELKOMSEL"|LAST|"SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL"
Can someone... (7 Replies)
Discussion started by: shis100
7 Replies
7. Shell Programming and Scripting
find "*.c" and "Makefile" and then delete them with one line (3 Replies)
Discussion started by: yanglei_fage
3 Replies
8. Shell Programming and Scripting
i need to substitute word on a specific line.
I was able to do it on command line like below but it is not working in vi.
command line like below:
sed -e '8s/table_name/schema.table_name/' file_name.
in vi table_name and schema are my positional parameters that i pass into the
script.
... (5 Replies)
Discussion started by: pimmit22043
5 Replies
9. Shell Programming and Scripting
Dear Ladies & Gents,
I have a requirement to delete all the log files in /var/log/test directory that are older than 10 days and their first line begin with "MSH" or "<?xml" or "FHS". I've put together the following BASH script, but it's erroring out:
for filename in $(find /var/log/test... (2 Replies)
Discussion started by: Hiroshi
2 Replies
10. Shell Programming and Scripting
SUSE linux
bash shell
this works
test -d /tmpp && echo "directory exists" || echo "directory doesn't exists" |sed -e "s/^/prefix /"
prefix directory doesn't exists
but why doesn't this work?
test -d /tmp && echo "directory exists" || echo "directory doesn't exists" |sed -e... (3 Replies)
Discussion started by: snoman1
3 Replies
LEARN ABOUT OPENSOLARIS
prtdscp
prtdscp(1M) System Administration Commands prtdscp(1M)
NAME
prtdscp - display DSCP IP addresses
SYNOPSIS
prtdscp [-v ]
prtdscp [-v ] -h
prtdscp [-v ] -d
prtdscp [-v ] -s
DESCRIPTION
prtdscp displays the IP addresses associated with a Domain to Service Processor Communications Protocol (DSCP) link. If no arguments are
specified, prtdscp displays the IP addresses on both ends of the DSCP link. The IP address of either the Service Processor or domain side
can be displayed separately by the use of the -s or -d options, respectively.
OPTIONS
The following options are supported:
-v Verbose mode. Print additional details about the program's internal progress to stderr.
-h Help. Print a brief synopsis of the program's usage and exit. All other command line arguments are ignored.
-d Display only the local domain's IP address.
-s Display only the remote Service Processor's IP address.
EXAMPLES
Example 1 Displaying both addresses
The following example displays both the local domain's IP address and the remote SP's IP address:
# prtdscp
Domain Address: 192.168.103.2
SP Address: 192.168.103.1
Example 2 Displaying the local IP address
The following example displays the local domain's IP address:
# prtdscp -d
192.168.103.2
Example 3 Displaying the remote IP address
The following example display the remote SP's IP address:
# prtdscp -s
192.168.103.1
ATTRIBUTES
See attributes(5) for descriptions of the following attributes:
+-----------------------------+-----------------------------+
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
+-----------------------------+-----------------------------+
|Availability |SUNWdscpr.u, SUNWdscpu.u |
+-----------------------------+-----------------------------+
|Interface Stability |Evolving |
+-----------------------------+-----------------------------+
SEE ALSO
attributes(5)
SunOS 5.11 25 Apr 2006 prtdscp(1M)