LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 04-04-2014, 06:04 AM   #1
anandrhce
LQ Newbie
 
Registered: Feb 2007
Posts: 17

Rep: Reputation: 0
Script for inserting a word


I need a script which will insert word "Dispatched" if its not present between job [ first line ] and Work [last line]

-----------------------------------------------
Job
$$$$$$$$$$$$$$$$$$$$$ [ symbols are file contents ]
##########################

Dispatched
Completed

####################
$$$$$$$$$$ Work
-----------------------------------------------

OR

if [ dispatched not present between Job and Work ] then

insert a new line with word "dispatched"


Thanks in advance..
 
Old 04-04-2014, 09:14 AM   #2
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,659

Rep: Reputation: 7970Reputation: 7970Reputation: 7970Reputation: 7970Reputation: 7970Reputation: 7970Reputation: 7970Reputation: 7970Reputation: 7970Reputation: 7970Reputation: 7970
Quote:
Originally Posted by anandrhce View Post
I need a script which will insert word "Dispatched" if its not present between job [ first line ] and Work [last line]
-----------------------------------------------
Job
$$$$$$$$$$$$$$$$$$$$$ [ symbols are file contents ]
##########################

Dispatched
Completed

####################
$$$$$$$$$$ Work
-----------------------------------------------

OR

if [ dispatched not present between Job and Work ] then insert a new line with word "dispatched"
Ok...you can easily write that script in any one of MANY languages. So post what you've written/tried so far, and tell us where you're stuck. But we're NOT going to write your scripts for you. We will be happy to help, but you do have to show some effort of your own.

There are MANY easily-found bash scripting tutorials, as well as sample code.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
linux Script required for word by word comaprison from 2 carat separated files. rajeevdvedi2006 Linux - Newbie 1 05-29-2013 06:24 AM
[SOLVED] Find/Replace shell script that replaces word with other word in text, filenames yanom Programming 8 09-12-2012 12:29 AM
inserting same word on different lines in vi texasj Linux - Newbie 4 08-04-2011 01:37 AM
How can i read two files word by word at a time using any loop by shell script? vaibhavs17 Programming 16 03-19-2010 03:48 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 06:46 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration