LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
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 02-02-2015, 03:41 AM   #1
murali2489
LQ Newbie
 
Registered: Jan 2015
Posts: 14

Rep: Reputation: Disabled
Post Better way of writing this command of leaving multiple blank lines


Hi All..

I need to give four lines of gap(Freespace) between two command outputs.

what i did was below

Code:
echo "" >>$LOG_DIR/$LOG_NAME
echo "" >>$LOG_DIR/$LOG_NAME
echo "" >>$LOG_DIR/$LOG_NAME
echo "" >>$LOG_DIR/$LOG_NAME
print "***************** LEVEL 2: Truncating  Tables: Success:  tables Truncated ***********************" >> $LOG/$LOG_NAME
echo "" >>$LOG_DIR/$LOG_NAME
echo "" >>$LOG_DIR/$LOG_NAME
echo "" >>$LOG_DIR/$LOG_NAME
echo "" >>$LOG_DIR/$LOG_NAME
# Run the load scripts.
echo "***************** LEVEL 3: Loading Dupe Check Tables: Success: Dupe Check tables Loaded***********************" >> $LOG/$LOG_NAME

Is there any better way of writing this command to leave multiple lines between two commands.

Please advise...
 
Old 02-02-2015, 04:38 AM   #2
TenTenths
Senior Member
 
Registered: Aug 2011
Location: Dublin
Distribution: Centos 5 / 6 / 7
Posts: 2,574

Rep: Reputation: 938Reputation: 938Reputation: 938Reputation: 938Reputation: 938Reputation: 938Reputation: 938Reputation: 938
Depending on your distro/shell (which you don't disclose) take a look at:

Code:
man echo
In general
Code:
echo -e "\n\n\n\n"
would give you 4 newlines.
 
Old 02-03-2015, 05:37 AM   #3
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.9, Centos 7.3
Posts: 17,417

Rep: Reputation: 2397Reputation: 2397Reputation: 2397Reputation: 2397Reputation: 2397Reputation: 2397Reputation: 2397Reputation: 2397Reputation: 2397Reputation: 2397Reputation: 2397
in bash you can also
Code:
printf "\n\n\n\n"
 
1 members found this post helpful.
  


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] how to type multiple command lines in the terminal Beukel Linux - Newbie 1 01-24-2014 07:04 PM
Make multiple blank lines to a single lines kimhj3715 Programming 5 06-10-2012 11:35 AM
[SOLVED] CAT command | multiple lines to multiple lines udiubu Programming 11 10-28-2011 07:09 AM
Multiple lines at the command line - how?! jsp_1983 Linux - Newbie 4 02-25-2011 09:04 PM
Delete Duplicate Lines in a file, leaving only the unique lines left xmrkite Linux - Software 6 01-14-2010 07:18 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 01:55 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