[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Help-bash] play audio-CD in consol
From: |
Chris F.A. Johnson |
Subject: |
Re: [Help-bash] play audio-CD in consol |
Date: |
Wed, 30 Jan 2013 12:45:24 -0500 (EST) |
User-agent: |
Alpine 2.00 (LMD 1167 2008-08-23) |
On Wed, 30 Jan 2013, Gerard ROBIN wrote:
On Wed, Jan 30, 2013 at 06:54:14AM +1100, Matthew Cengia wrote:
...
I would like to know if to display the 3 following lines:
foo bar base
foo bar base foo bar baz
foo bar base foo bar baz foo bar base
it is the appropriate way to write:
line1="foo bar base"
line2="foo bar base foo bar baz"
line3="foo bar base foo bar baz foo bar base"
printf "%$((${#line1}+10))s\n%$((${#line2}+10))s\n%$((${#line3}+10))s\n" "$line1"
"$line2" "$line3"
If yes, printf is hard to read (and write) too. If not, how can we write
this most simply ? ( with printf )
printf " %s\n" "$line1" "$line2" "$line3"
--
Chris F.A. Johnson, <http://cfajohnson.com/>
Author:
Pro Bash Programming: Scripting the GNU/Linux Shell (2009, Apress)
Shell Scripting Recipes: A Problem-Solution Approach (2005, Apress)