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 Tue 21 Oct 2014, 20:26
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 Posts_count  
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: 3966
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: 3966
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: 3966
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:   Sort by:   
Page 1 of 1 Posts_count  
Post_new_topic   Reply_to_topic View_previous_topic :: View_next_topic
 Forum index » House Training » Beginners Help ( Start Here)
Jump to:  

Rules_post_cannot
Rules_reply_cannot
Rules_edit_cannot
Rules_delete_cannot
Rules_vote_cannot
You cannot attach files in this forum
You can download files in this forum


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