Sponsored Content
Top Forums Shell Programming and Scripting Replace line and field using SED and/or AWK or some other suggestion Post 302600329 by complex.invoke on Monday 20th of February 2012 10:01:24 PM
Old 02-20-2012
Code:
[root@node2 ~]# cat file1
ROB A B A
DAN A C B
JOHN C B A
[root@node2 ~]# sed 's/JOHN.*/SAM A A A/g' file1
ROB A B A
DAN A C B
SAM A A A
[root@node2 ~]# cat file2
ROB A A A
DAN A A A
JOHN A A A
[root@node2 ~]# sed '/ROB/s/A/B/2' file2
ROB A B A
DAN A A A
JOHN A A A

 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Replace password field using ed/sed

I need to edit the password file to change the password field to *LK* for a specified account (abctest) like: abctest:*LK*:135:20::/home/abctest:/sbin/sh Can anyone help me do this using ed or sed? Thanks a lot! (6 Replies)
Discussion started by: munch
6 Replies

2. Shell Programming and Scripting

Replace part of a line with sed/awk

Hello I have a document and in this document I have several occurrence of "VAR == xxxxxxx" and xxxxx can be anything. I don't know what it is. I want to replace the 'xxxxx's with something I know. What I know however, is the line numbers of the VAR =='s in the file. How can I replace... (1 Reply)
Discussion started by: alirezan
1 Replies

3. UNIX for Dummies Questions & Answers

howto replace field in line

Hi all, I'm writing a script in bash where i'm reading line by line into variable, and the i want to replace the second filed in the line with another number, for example if the line looks like this: 10 20 30 40 50 it should look like this: 10 90 30 40 50 and put the new result inside... (1 Reply)
Discussion started by: morfix
1 Replies

4. Shell Programming and Scripting

Replace specific field on specific line sed or awk

I'm trying to update a text file via sed/awk, after a lot of searching I still can't find a code snippet that I can get to work. Brief overview: I have user input a line to a variable, I then find a specific value in this line 10th field in this case. After asking for new input and doing some... (14 Replies)
Discussion started by: crownedzero
14 Replies

5. Shell Programming and Scripting

sed or awk to replace a value in a certain line.

I have an input like following. *DEFINE_CURVE_TITLE Force for tool binder $# lcid sidr sfa sfo offa offo dattyp 3 0 1 .000000 125.00000 0.000 0.000 0 $# a1 ... (5 Replies)
Discussion started by: hamnsan
5 Replies

6. Shell Programming and Scripting

sed or awk to replace a value in a certain line containing a string

hi experts , I have an input like following. R sfst 1000.0000 $ new time step for mass scaled calculation R dt2ms -4.000E-7 $ friction value for blank R mue ... (10 Replies)
Discussion started by: hamnsan
10 Replies

7. Shell Programming and Scripting

sed to replace a field from a line with another field

i have something like this, cat filename.txt hui this si s"dfgdfg" omeone ipaddress="10.19.123.104" wel hope this works i want to replace only 10.19.123.104 with different ip say 10.19.123.103 i tried this sed -i "s/'ipaddress'/'ipaddress=10.19.123.103'/g" filename.txt ... (1 Reply)
Discussion started by: vivek d r
1 Replies

8. Shell Programming and Scripting

sed or awk to replace a value in a certain line from another file containing a string

Hi experts, In my text file I have the following alot of lines like below. input.k is as follows. 2684717 -194.7050476 64.2345581 150.6500092 0 0 2684718 -213.1575623 62.7032242 150.6500092 0 0 *INCLUDE $# filename... (3 Replies)
Discussion started by: hamnsan
3 Replies

9. Shell Programming and Scripting

Replace first field of a line with previous filed of the line

Hi Everyone, I have a file as below: IM2345638,sherfvf,usha,30 IM384940374,deiufbd,usha,30 IM323763822,cdejdkdnbds,theju,15 0,dhejdncbfd,us,20 IM398202038,dhekjdkdld,tj,30 0,foifsjd,u2,40 The output i need is as below IM2345638,sherfvf,usha,30... (4 Replies)
Discussion started by: usha rao
4 Replies

10. Shell Programming and Scripting

Multiple line search, replace second line, using awk or sed

All, I appreciate any help you can offer here as this is well beyond my grasp of awk/sed... I have an input file similar to: &LOG &LOG Part: "@DB/TC10000021855/--F" &LOG &LOG &LOG Part: "@DB/TC10000021852/--F" &LOG Cloning_Action: RETAIN &LOG Part: "@DB/TCCP000010713/--A" &LOG &LOG... (5 Replies)
Discussion started by: KarmaPoliceT2
5 Replies
orte-clean(1)							     Open MPI							     orte-clean(1)

NAME
orte-clean - Cleans up any stale processes and files leftover from Open MPI jobs. SYNOPSIS
orte-clean [--verbose] mpirun --pernode [--host | --hostfile file] orte-clean [--verbose] OPTIONS
[-v | --verbose] This argument will run the command in verbose mode and print out the universes that are getting cleaned up as well as pro- cesses that are being killed. DESCRIPTION
orte-clean attempts to clean up any processes and files left over from Open MPI jobs that were run in the past as well as any currently running jobs. This includes OMPI infrastructure and helper commands, any processes that were spawned as part of the job, and any temporary files. orte-clean will only act upon processes and files that belong to the user running the orte-clean command. If run as root, it will kill off processes belonging to any users. When run from the command line, orte-clean will attempt to clean up the local node it is run from. When launched via mpirun, it will clean up the nodes selected by mpirun. EXAMPLES
Example 1: Clean up local node only. example% orte-clean Example 2: To clean up on a specific set of nodes specified on command line, it is recommended to use the pernode option. This will run one orte-clean for each node. example% mpirun --pernode --host node1,node2,node3 orte-clean To clean up on a specific set of nodes from a file. example% mpirun --pernode --hostfile nodes_file orte-clean Example 3: Within a resource managed environment like N1GE, SLURM, or Torque. The following example is from N1GE. First, we see that we have two nodes with two CPUs each. example% qsh -pe orte 4 example% mpirun -np 4 hostname node1 node1 node2 node2 Clean up all the nodes in the cluster. example% mpirun --pernode orte-clean Clean up a subset of the nodes in the cluster. example% mpirun --pernode --host node1 orte-clean SEE ALSO
orterun(1), orte-ps(1) 1.4.5 Feb 10, 2012 orte-clean(1)
All times are GMT -4. The time now is 04:10 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy