Could someone tell me how to replace a word at a particular line by a single SED or AWK command?
e.g. I have a file with the contents below:
$ cat file1
111 AAA
333 CCC
222 BBB
444 CCC
I want to replace the word "CCC" with a blank to get the desired output below:
111 AAA
333 CCC... (3 Replies)
I have a file like this..
Maharastra Mumbai worli
Maharastra Mumbai navy
maharatra Pune
Maharastra Nagpur
Karnataka Bangalore
Karnataka Mysore
Karnataka Mangalore
Punjab Amritsar
punjab Jalandar
my expected outcome should be like this
Maharastra Mumbai worli
---------- ... (9 Replies)
Hi folks,
have a look into the attachment, i am not familiar with unix, can you please help me in this regard.
thanks in advance, :)
regards,
Geeko (4 Replies)
Hi friends,
i just want to know the command though which i can get the next word which comes just after a particluar keyword. For example:
suppose text.out is file which contains a pl/sql procedure . i want to find out the word which falls just after the "table1" keyword.
Thank... (7 Replies)
Hi,
I have been trying to replace the key word
"SQL> spool off "
with
"/
show errors"
with out double quotes in all the files in a directory.
above show erros should be displayed next line
Could you please help me how to do that.
I have tried something like this... (3 Replies)
How to catch a two word keyword which may contain a new line(may include spaces or tab) in it.
for example there is a file a.txt.
$more a.txt
create view
as
(select from
.........
..........
( select
....
(
select
......
..
select only no (((
number
( select
end (12 Replies)
Hi
I want to implement something like this:
if( keyword1 exists)
then
check if(keyword2 exists in the same line)
then replace keyword 2 with New_Keyword
else
Add New_Keyword at the end of line
end if
eg:
Check for Keyword JUNGLE and add/replace... (7 Replies)
Hi Everyone,
Need help in extracting the hostname from the below output.
Expected output:
DS-TESTB-GDS-1.TEST.ABC.COM
DS-TESTB-GDS-2.TEST.ABC.COM
....
...
/tmp $ cat -n /tmp/patchreport
1 /usr/bin/perl /admin/bin/patch/applyPatches.pl --apply_patches... (4 Replies)
I have query to replace the first word in line using below code but its replace the middle word too
sed -i 's/load /# LOAD/' /tmp/check.sql
Query 1 :
UPDATE accheadcon_data_last_upload SET last_upload_date = '2017-07-23'
Replace to
UPDATE accheadcon_data_last_up# LOAD SET... (1 Reply)
Discussion started by: kaushik02018
1 Replies
LEARN ABOUT V7
accept
accept(1M) System Administration Commands accept(1M)NAME
accept, reject - accept or reject print requests
SYNOPSIS
accept destination...
reject [-r reason] destination...
DESCRIPTION
accept allows the queueing of print requests for the named destinations.
reject prevents queueing of print requests for the named destinations.
Use lpstat -a to check if destinations are accepting or rejecting print requests.
accept and reject must be run on the print server; they have no meaning to a client system.
OPTIONS
The following options are supported for reject:
-r reason Assigns a reason for rejection of print requests for destination. Enclose reason in quotes if it contains blanks. reason
is reported by lpstat -a. By default, reason is unknown reason for existing destinations, and new printer for destinations
added to the system but not yet accepting requests.
OPERANDS
The following operands are supported.
destination The name of the destination accepting or rejecting print requests. Destination specifies the name of a printer or class of
printers (see lpadmin(1M)). Specify destination using atomic name. See printers.conf(4) for information regarding the
naming conventions for atomic names.
EXIT STATUS
The following exit values are returned:
0 Successful completion.
non-zero An error occurred.
FILES
/var/spool/lp/* LP print queue.
ATTRIBUTES
See attributes(5) for descriptions of the following attributes:
+-----------------------------+-----------------------------+
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
+-----------------------------+-----------------------------+
|Availability |SUNWpcu |
+-----------------------------+-----------------------------+
|CSI |Enabled (see NOTES) |
+-----------------------------+-----------------------------+
SEE ALSO enable(1), lp(1), lpstat(1), lpadmin(1M), lpsched(1M), printers.conf(4), attributes(5)NOTES
accept and reject affect only queueing on the print server's spooling system. Requests made from a client system remain queued in the
client system's queueing mechanism until they are cancelled or accepted by the print server's spooling system.
accept is CSI-enabled except for the destination name.
SunOS 5.10 8 Feb 1999 accept(1M)