Sponsored Content
Operating Systems Linux Red Hat How to add a new string at the end of line by searching a string on the same line? Post 302909202 by in2nix4life on Tuesday 15th of July 2014 11:20:19 AM
Old 07-15-2014
If you have GNU sed available:

Code:
sed -r '/^condition/s/(.*)/& \& s(new_job_dependency)/' infile

 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

To cut end string from line

HI, I want to cut end string from line. e.g. i have following input line /users/home/test.txt I want to get end string 'test.txt' from above line and length of that end string will change and it always start after '/'. Thanks, Visu (7 Replies)
Discussion started by: visu
7 Replies

2. Shell Programming and Scripting

Add string end of line

Hello How can I add a string (always the same) at the end of a specific line in a file... The file is: 000000001 041 L $$aspa 000000001 088 L $$aJ.E.N. 551 000000001 090 L $$aINFORMES JEN 000000001 100 L $$aautor 1 ---- 000000002 041 L $$aeng 000000002 088 L $$aJ.E.N. 1... (13 Replies)
Discussion started by: ldiaz2106
13 Replies

3. Shell Programming and Scripting

put string end of the line

I've a problem to put .h end of the line..below my input file fg_a bb fg_b bb fg_c bb fg_d aa fg_f ee and i want the output file as below fg_a.h bb fg_b.h bb fg_c.h bb fg_d.h (6 Replies)
Discussion started by: zulabc
6 Replies

4. Shell Programming and Scripting

Search a string and to add another string after that in new line

Hi Guys I am facing a problem:wall: In searching a string in a file and to add another string(ie. passed through command line argument) just after this(searched) string in new line. Thanks (2 Replies)
Discussion started by: kushwaha
2 Replies

5. Shell Programming and Scripting

Search a string in a text file and add another string at the particular position of a line

I am having a text file which is having more than 200 lines. EX: 001010122 12000 BIB 12000 11200 1200003 001010122 2000 AND 12000 11200 1200003 001010122 12000 KVB 12000 11200 1200003 In the above file i want to search for string KVB and add/replace... (1 Reply)
Discussion started by: suryanarayana
1 Replies

6. Shell Programming and Scripting

Search a string in a text file and add another string at the end of line

Dear All I am having a text file which is having more than 200 lines. EX: 001010122 12000 BIB 12000 11200 1200003 001010122 2000 AND 12000 11200 1200003 001010122 12000 KVB 12000 11200 1200003 In the above file i want to search for string KVB... (5 Replies)
Discussion started by: suryanarayana
5 Replies

7. Shell Programming and Scripting

Append this string to end of each line

Platform: Solaris 10 I have a file like below $ cat languages.txt Spanish Norwegian English Persian German Portugese Chinese Korean Hindi Malayalam Bengali Italian Greek Arabic I want to append the string " is a great language" at end of each line in this file. (3 Replies)
Discussion started by: omega3
3 Replies

8. Shell Programming and Scripting

Add Date string at end of line

HOWTO Append Date String (MMYYYY) to End of Line file A.txt B.txt Output: A_052014.txt B_052014.txt (9 Replies)
Discussion started by: satish1222
9 Replies

9. Shell Programming and Scripting

Suppress new line at end here string?

I'm trying to fully escape/quote a directory path for use in a regular expression with no characters interpreted symbolically. Printable characters get \* and white space gets "*" $ inputDirectory="/home/dir1/dir/" $ echo $( { while read -r -n1 a; do ] ]] && echo -n "\"""$a""\"" || echo -n... (7 Replies)
Discussion started by: Michael Stora
7 Replies

10. Shell Programming and Scripting

Printing string from last field of the nth line of file to start (or end) of each line (awk I think)

My file (the output of an experiment) starts off looking like this, _____________________________________________________________ Subjects incorporated to date: 001 Data file started on machine PKSHS260-05CP ********************************************************************** Subject 1,... (9 Replies)
Discussion started by: samonl
9 Replies
jobs(1) 						      General Commands Manual							   jobs(1)

NAME
jobs - Displays status of jobs in the current session SYNOPSIS
jobs [-l | -p] job_id... [Tru64 UNIX] jobs [-n] job_id... Note The C shell has a built-in version of the jobs command. If you are using the C shell, and want to guarantee that you are using the command described here, you must specify the full path /usr/bin/jobs. See the csh(1) reference page for a description of the built-in command. STANDARDS
Interfaces documented on this reference page conform to industry standards as follows: jobs: XCU5.0 Refer to the standards(5) reference page for more information about industry standards and associated tags. OPTIONS
Provides more information about each job listed. This information includes the job number, current job, process group ID, state and the command that formed the job. Displays only the process IDs for the process group leaders of the selected jobs. [Tru64 UNIX] Displays jobs that have stopped or exited since last notified. By default, the jobs utility displays the status of all stopped jobs, running background jobs and all jobs whose status has changed and has not been reported by the shell. OPERANDS
Specifies the jobs for which the status is to be displayed. If no job_id operand is given, the status information for all jobs is dis- played. The format of job_id is described in the Jobs section of the ksh(1) reference page. DESCRIPTION
The jobs utility displays the status of jobs that were started in the current shell environment. When jobs reports the termination status of a job, the shell removes its process ID from the list of those "known in the current shell exe- cution environment". See the Jobs section of the ksh(1) reference page. RESTRICTIONS
The jobs utility does not work as expected when it is operating in its own utility execution environment because that environment has no applicable jobs to manipulate. EXIT STATUS
The following exit values are returned: Successful completion. An error occurred. ENVIRONMENT VARIABLES
The following environment variables affect the execution of jobs: Provides a default value for the internationalization variables that are unset or null. If LANG is unset or null, the corresponding value from the default locale is used. If any of the internationalization vari- ables contain an invalid setting, the utility behaves as if none of the variables had been defined. If set to a non-empty string value, overrides the values of all the other internationalization variables. Determines the locale for the interpretation of sequences of bytes of text data as characters (for example, single-byte as opposed to multibyte characters in arguments). Determines the locale used to affect the format and contents of diagnostic messages written to standard error and informative messages written to standard output. Determines the location of message catalogues for the processing of LC_MESSAGES. SEE ALSO
Commands: bg(1), csh(1), fg(1), kill(1), ksh(1), sh(1p), wait(1) Standards: standards(5) jobs(1)
All times are GMT -4. The time now is 05:57 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy