LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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-03-2014, 12:10 PM   #1
tkinsella
Member
 
Registered: Dec 2005
Distribution: CentOS 6.5
Posts: 45

Rep: Reputation: 0
Bash ECHO new line


I have the following command :
Code:
PACKAGES=$(rpm -qa | sort)
echo $PACKAGES'\n'
But it returns all the packages in a single line still.... Any ideas how to list them one per line?

Current :
Code:
subversion-1.6.11-9.el6_4.x86_64 sudo-1.8.6p3-12.el6.x86_64 swig-1.3.40-6.el6.x86_64 system-config-firewall-base-1.2.27-5.el6.noarch systemtap-2.3-3.el6.x86_64 systemtap-client-2.3-3.el6.x86_64 systemtap-devel-2.3-3.el6.x86_64 systemtap-runtime-2.3-3.el6.x86_64 sysvinit-tools-2.87-5.dsf.el6.x86_64
Would Like :
Code:
subversion-1.6.11-9.el6_4.x86_64
sudo-1.8.6p3-12.el6.x86_64
swig-1.3.40-6.el6.x86_64
system-config-firewall-base-1.2.27-5.el6.noarch
systemtap-2.3-3.el6.x86_64
systemtap-client-2.3-3.el6.x86_64
systemtap-devel-2.3-3.el6.x86_64
systemtap-runtime-2.3-3.el6.x86_64
sysvinit-tools-2.87-5.dsf.el6.x86_64
 
Old 02-03-2014, 12:24 PM   #2
Habitual
LQ Addict
 
Registered: Jan 2011
Posts: 8,563
Blog Entries: 13

Rep: Reputation: Disabled
Code:
echo -n "$PACKAGES"
 
1 members found this post helpful.
Old 02-03-2014, 12:31 PM   #3
tkinsella
Member
 
Registered: Dec 2005
Distribution: CentOS 6.5
Posts: 45

Original Poster
Rep: Reputation: 0
Thanks!!!
 
Old 02-03-2014, 01:41 PM   #4
Habitual
LQ Addict
 
Registered: Jan 2011
Posts: 8,563
Blog Entries: 13

Rep: Reputation: Disabled
You're very welcome!
 
  


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
bash: echo followed by command on the same line ??? RandyTech Linux - Newbie 11 02-01-2013 10:35 AM
bash, echo redirection not to the last line but first Xeratul Programming 2 09-03-2012 02:05 AM
[SOLVED] multi-line output from a bash script using echo and tr Leo Simon Linux - General 7 08-15-2012 02:05 AM
how to remove new line in bash using echo packets Programming 9 11-24-2009 09:00 PM
Bash Script, no new line for echo command jorisb Linux - General 5 11-05-2005 12:08 AM

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

All times are GMT -5. The time now is 05:00 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration