Adding line in a file using info from previous line
I have a shell script that looks something like the following:
different db names in more than 160 lines.
I want to run this script with nohup and have a status later.
So, basically, I need a quick fix to insert another line after each restore command above that says the database is restored.
How can this be done with vi and unix utilities?
Thanks in advance,
-MKH
Last edited by Don Cragun; 11-01-2014 at 04:22 PM..
Reason: Add CODE tags.
Hi all,
Please help me in providing sample code to append the following 4 lines in one row.
Input :
A1/EXT "BAPBSC10/07B/00" 523 090530 0115
RXOCF-430 HY1711 1
EXTERNAL ALARM
DOOR ALARM
Output should be :
A1/EXT "BAPBSC10/07B/00" 523 090530 0115 ... (8 Replies)
Hi folks,
I've list of LDAP records in this format:
cat cmmac.export.tmp2
dn: deviceId=0a92746a54tbmd34b05758900131136a506,ou=devices,ou=customer,ou=nl,o=upc
cmmac: 00:13:11:36:a5:06
dn: deviceId=0a92746a62pbms4662299650015961cfa23,ou=devices,ou=customer,ou=nl,o=upc
cmmac:... (4 Replies)
I have a LOG file which looks like this
Import started at: Mon Jul 23 02:13:01 EDT 2012
Initialization completed in 2.146 seconds.
--------------------------------------------------------------------------------
--
Import summary for Import item: PolicyInformation... (8 Replies)
Hello Everyone,
I need a help from experts of this community regarding one of the issue that I am facing with shell scripting.
My requirement is to append char's at the end of each line of a file. The char that will be appended is variable and will be passed through command line.
The... (20 Replies)
I am trying to delete lines in archived Apache httpd logs
Each line has the pattern:
<ip-address> - - <date-time> <document-request-URL> <http-response> <size-of-req'd-doc> <referring-document-URL>
This pattern is shown in the example of 6 lines from the log in the code box below. These 6... (1 Reply)
I have two files (csv and vcf) which look exactly like this
S1.csv
func,gene,start,info
"exonic","AL","2309","het"
"exonic","NEF","6912","hom"S1.vcf
##fileinfo
#CHROM POS ID INFO
chr1 4567 rs323211 1/1:84,104,99
chr4 2309 rs346742 1/1:27,213,90
chr6 5834 ... (5 Replies)
Hi ,
i have a file with data as below.This is same file. But actual file contains to many rows.
i want to search for a string "Field 039 00" and delete that line and previous 3 lines in that file.. Can some body suggested me how can i do using either sed or awk command ?
Field 004... (7 Replies)
Hello,
I have below format log file,
Comparing csv_converted_files/2201/9747.1012H67126.5077292103609547345.csv and csv_converted_files/22019/97447.1012H67126.5077292103609547345.csv
Comparing csv_converted_files/2559/9447.1012H67126.5077292103609547345.csv and... (6 Replies)
Hi,
i have a file with multiple entries. After some tests with sed i managed to get the file output as follows:
lsn=X-LINK-IN0,apc=661:0,state=avail,avail/links=1/1,
00,2110597,2094790,0,81,529,75649011,56435363,
lsn=TM1ITP1-AM1ITP1-LS,apc=500:0,state=avail,avail/links=1/1,... (5 Replies)
Discussion started by: nms
5 Replies
LEARN ABOUT HPUX
cmrunserv
cmrunserv(1m)cmrunserv(1m)NAME
cmrunserv - run a service from the high availability package run script
SYNOPSIS
cmrunserv [-v] service_name service_command_string
cmrunserv [-v] [-r restarts] service_name service_command_string
cmrunserv [-v] [-R] service_name service_command_string
DESCRIPTION
cmrunserv is used in the high availability package run script to run a service.
To start package's service, a user must either be superuser(UID=0), or have an access policy of FULL_ADMIN allowed in the cluster configu-
ration file. See access policy in cmquerycl(1m) or cmmakepkg(1m).
If the service process dies, cmrunserv updates the status of the service to down. The cluster software will recognize the change in status
and execute the normal package recovery sequence. This includes executing the package halt script, determining if the package can be run
on a different node, and, if so, executing the package run script on the new node.
Should the service_command be halted by the cmhaltserv command, a SIGTERM signal will be sent to the process. This executable or shell
script should be able to handle a SIGTERM signal and execute a graceful shutdown performing any cleanup necessary. If the process ignores
the SIGTERM, a SIGKILL will be sent to the process. If a SIGKILL is sent, the process will die immediately and will be unable to perform
any cleanup.
Options
cmrunserv supports the following options.
-v Verbose output will be displayed.
-r restarts
Indicates that the service should be automatically restarted by the cluster software if it fails, without halting the
package. restarts indicates how many times the service may fail before the package should be halted.
-R Indicates the service should be restarted an unlimited number of times if it fails.
service_name
Name of the service as it exists in the package configuration information.
service_command_string
Process string to be started. This includes the process name and any arguments necessary for the process to run. The
process name must be a full path, may be either a command name or a shell script, and must be executable.
RETURN VALUE
cmrunserv returns the following values:
0 Successful completion.
1 Command failed.
EXAMPLES
To run the service command string /var/opt/db/database1 under the service name db1, do the following:
# Run the process /var/opt/db/database1
cmrunserv db1 /var/opt/db/database1
This line should only be executed within a package run script.
AUTHOR
cmrunserv was developed by HP.
SEE ALSO cmhaltserv(1m), cmquerycl(1m), cmmakepkg(1m), cmmodnet(1m).
Requires Optional Serviceguard Software cmrunserv(1m)