Register
It is currently Sun Apr 20, 2014 10:05 am

multiple spaces at end of variable impossible?


All times are UTC - 6 hours


Post new topic Reply to topic  [ 5 posts ] 
Author Message
 PostPosted: Sun Mar 14, 2010 4:43 pm   

Joined: Wed Mar 10, 2010 8:05 pm
Posts: 25
wtf.

Code:
caibbor@localhost ~ $ a="spaces      "
caibbor@localhost ~ $ echo [$a]
[spaces ]
caibbor@localhost ~ $ a='spaces      '
caibbor@localhost ~ $ echo [$a]
[spaces ]
caibbor@localhost ~ $ b=" "
caibbor@localhost ~ $ a="spaces$b$b$b$b$b"
caibbor@localhost ~ $ echo [$a]
[spaces ]


Top
 Profile  
 PostPosted: Sun Mar 14, 2010 8:04 pm   

Joined: Mon Mar 02, 2009 3:03 am
Posts: 512
umq
Code:
a="spaces      "
echo "[$a]"
[spaces      ]


Top
 Profile  
 PostPosted: Mon Mar 15, 2010 4:21 am   
Moderator
User avatar

Joined: Thu Oct 11, 2007 7:12 am
Posts: 224
Location: London - UK
nasty :P


Top
 Profile  
 PostPosted: Tue Mar 16, 2010 4:09 pm   

Joined: Mon Mar 02, 2009 3:03 am
Posts: 512
what/who is nasty?

three letters asking => three letters answered
(:~ => O:-)
yes?


Top
 Profile  
 PostPosted: Thu Mar 18, 2010 4:53 am   
Moderator
User avatar

Joined: Thu Oct 11, 2007 7:12 am
Posts: 224
Location: London - UK
lol I mean bash is nasty for stripping the spaces in an unintuitive style. It's an example of why on more complex scripts I use Perl.
>:)


Top
 Profile  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 

All times are UTC - 6 hours


Who is online

Users browsing this forum: Bing [Bot] and 6 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  


BashScripts | Promote Your Page Too
Powered by phpBB © 2011 phpBB Group
© 2003 - 2011 USA LINUX USERS GROUP