Puppy Linux Discussion Forum Forum Index Puppy Linux Discussion Forum
Puppy HOME page : puppylinux.com
"THE" alternative forum : puppylinux.info
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

The time now is Thu 23 Oct 2014, 14:55
All times are UTC - 4
 Forum index » House Training » Beginners Help ( Start Here)
Can You Upgrade Bash In Puppy Linux 5.4.3?
Moderators: Flash, Ian, JohnMurga
Post new topic   Reply to topic View previous topic :: View next topic
Page 1 of 1 [7 Posts]  
Author Message
Gnuxo

Joined: 09 Feb 2012
Posts: 365

PostPosted: Thu 28 Feb 2013, 19:52    Post subject:  Can You Upgrade Bash In Puppy Linux 5.4.3?  

I've been trying to learn some Bash, and practicing if and then statements by writing a few newbie scripts but I keep getting syntax errors on almost everything I try.

I did a version check on Bash and found out that it's version 3.00 and that might explain why it's not responding to some of my bash commands.

Can Bash be updated? Or is there a workaround?
Back to top
View user's profile Send private message 
Semme

Joined: 07 Aug 2011
Posts: 3968
Location: World_Hub

PostPosted: Thu 28 Feb 2013, 20:06    Post subject:  

Sure (PPM). While an example error would've helped, you probably want coreutils. Check if it's installed..
Back to top
View user's profile Send private message 
Gnuxo

Joined: 09 Feb 2012
Posts: 365

PostPosted: Fri 01 Mar 2013, 01:46    Post subject:  

Coreutils is actually installed.

...and the example isn't very long. Just a little joke bash script I tried writing.

#!/bin/bash
clear
echo 'Say Please'
read word

clear
if [ ${word,,} = "please" ]
then
echo 'Thank you.'
fi

In that instance, line 7 ${word,,} comes up as a bad substitution error.

I couldn't understand why. And then I guessed that maybe the version of Bash is too old.
Back to top
View user's profile Send private message 
Semme

Joined: 07 Aug 2011
Posts: 3968
Location: World_Hub

PostPosted: Fri 01 Mar 2013, 09:42    Post subject:  

I doubt the bash version's your problem. It's understanding, and you need help.

Saying you run frugal, I suppose you could <IF you really needed to> upgrade..
Code:
GNU bash, version 4.2.24(1)-release-(i686-pc-linux-gnu)

Page search *read* for examples >> http://tldp.org/LDP/abs/html/

As far as coreutils, you have a version of it.

If GNU was installed, you'd be able to: which unlink and find it.

Send Flash a pm- have'm move this thread to Programming.
Back to top
View user's profile Send private message 
SFR


Joined: 26 Oct 2011
Posts: 1078

PostPosted: Fri 01 Mar 2013, 10:57    Post subject:  

Gnuxo wrote:
In that instance, line 7 ${word,,} comes up as a bad substitution error.

I couldn't understand why. And then I guessed that maybe the version of Bash is too old.

Indeed: ,, (convert to lowercase) is Bash 4 specific. To make it compatibile with Bash 3, you can use, for instance:
Code:
if [ "`echo ${word} | tr [:upper:] [:lower:]`" = "please" ]

Greetings!

_________________
[O]bdurate [R]ules [D]estroy [E]nthusiastic [R]ebels => [C]reative [H]umans [A]lways [O]pen [S]ource
Omnia mea mecum porto.
Back to top
View user's profile Send private message 
Semme

Joined: 07 Aug 2011
Posts: 3968
Location: World_Hub

PostPosted: Fri 01 Mar 2013, 11:00    Post subject:  

Ah.. WHO Wink I was hoping would post! Me? I'd never have guessed..
Back to top
View user's profile Send private message 
Gnuxo

Joined: 09 Feb 2012
Posts: 365

PostPosted: Fri 01 Mar 2013, 21:19    Post subject:  

I'm still getting strange errors.

Does puppy even come with tr? I heard that some stripped down systems don't come with it.

edit: Nevermind. It works. Thank you very much for the help.
Back to top
View user's profile Send private message 
Display posts from previous:   Sort by:   
Page 1 of 1 [7 Posts]  
Post new topic   Reply to topic View previous topic :: View next topic
 Forum index » House Training » Beginners Help ( Start Here)
Jump to:  

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 vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.0685s ][ Queries: 11 (0.0196s) ][ GZIP on ]