LinuxQuestions.org
Register a domain and help support LQ
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 09-19-2014, 05:34 AM   #1
LYC
Member
 
Registered: Jan 2014
Posts: 100

Rep: Reputation: Disabled
Script queries


Hi,

I have a file with content as follows:

aaaaa
bbbbb
ccccc

Is there a way to insert the following pattern in between?

echo " "
echo "#### ####"
echo " "
aaaaa
echo " "
echo "#### ####"
echo " "
bbbbb
echo " "
echo "#### ####"
echo " "
cccc

Thanks in advance.
 
Old 09-19-2014, 06:42 AM   #2
kaushalpatel1982
Member
 
Registered: Aug 2007
Location: INDIA
Distribution: CentOS, RHEL, Fedora, Debian, Ubuntu, LinuxMint, PCLinuxOS
Posts: 153

Rep: Reputation: 9
let say you have 1.txt contains the lines you wrote. Run below command in your script or run it directly from shell

Quote:
cat 1.txt | while read line; do echo "############"; echo $line; done
It's output is as below :

Quote:
############
aaaaa
############
bbbbb
############
ccccc

Last edited by kaushalpatel1982; 09-19-2014 at 06:44 AM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
[SOLVED] Run bash script w/ sql queries using cron (RHEL 5.7, Oracle 11g) gacanepa Linux - Newbie 2 10-12-2013 10:49 AM
Script to mail output of Mysql Queries adarshmca Linux - Newbie 2 03-15-2011 08:58 PM
Script to mail Mysql Queries adarshmca Linux - Newbie 1 02-15-2011 08:48 AM
PHP Script to retrieve queries from log file saravanan1979 Programming 1 03-17-2002 09:13 AM


All times are GMT -5. The time now is 06:35 AM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration