LinuxQuestions.org
Help answer threads with 0 replies.
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 10-31-2013, 12:28 PM   #1
casperdaghost
Member
 
Registered: Aug 2009
Posts: 349

Rep: Reputation: 16
range operator bash - change the output


Using the range operator I get this on the echo:

Code:
[icasper@capserbox bin]$ echo {1..9}
1 2 3 4 5 6 7 8 9
[icasper@capserbox bin]$
is there a way to echo this out to :
Code:
1var 2var 3var 4var 5var 6var 7var 8var 9var
 
Old 10-31-2013, 01:17 PM   #2
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2389Reputation: 2389Reputation: 2389Reputation: 2389Reputation: 2389Reputation: 2389Reputation: 2389Reputation: 2389Reputation: 2389Reputation: 2389Reputation: 2389
Have a look at this:
Code:
$ echo {1..9}var
1var 2var 3var 4var 5var 6var 7var 8var 9var
Have a look at the bash manual page (the Brace Expansion section).
 
  


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 script to ping a range or own IP-range ugurgazi Programming 13 05-02-2016 09:08 AM
bash <> operator fakie_flip Programming 3 10-28-2012 03:30 PM
Bash problem : -bash: [: /bin/bash: unary operator expected J.A.X Linux - Software 1 09-22-2011 05:52 AM
The modulus operator in UNIX throws random values giving weird output gaynut Programming 5 07-08-2008 12:15 AM
bash script and the , operator xviddivxoggmp3 Programming 1 08-14-2004 12:33 AM


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