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 28 Aug 2014, 01:10
All times are UTC - 4
 Forum index » House Training » Users ( For the regulars )
The Text-User Interface
Moderators: Flash, Ian, JohnMurga
Post new topic   Reply to topic View previous topic :: View next topic
Page 8 of 8 [110 Posts]   Goto page: Previous 1, 2, 3, ..., 6, 7, 8
Author Message
MrDurtal


Joined: 22 Apr 2011
Posts: 7

PostPosted: Fri 02 Dec 2011, 09:03    Post subject: Excellent source of help!  

Thanks very much for all of the effort.

MrDurtal
Back to top
View user's profile Send private message 
rhadon


Joined: 27 Mar 2008
Posts: 1291
Location: Germany

PostPosted: Wed 08 Feb 2012, 05:05    Post subject:  

Hi,

I have a general question. I can write
Code:
if ...condition...;then
   do this...
fi
if not...condition...;then
   do that...
fi

or I can write
Code:
if ...condition...;then
   do this...
else
   do that...
fi


It looks to me that the last one is 'better style' but is it really better, maybe faster?

Concrete example, with slacko 5.3.2.1 in rcsysinit, ~line 754 is written:
Code:
#save button on desktop when booted from flash drive...
if [ $PUPMODE -eq 3 -o $PUPMODE -eq 7 -o $PUPMODE -eq 13 ];then #pup_rw is tmpfs.
 if [ "`cat /root/Choices/ROX-Filer/PuppyPin | grep "save2flash"`" = "" ];then
  echo '<icon x="768" y="128" label="save">/usr/sbin/save2flash</icon>' >> /root/Choices/ROX-Filer/PuppyPin
  cat /root/Choices/ROX-Filer/PuppyPin | grep -v '/pinboard' > /tmp/PuppyPin-CPY
  sync
  cp -f /tmp/PuppyPin-CPY /root/Choices/ROX-Filer/PuppyPin
  echo '</pinboard>' >> /root/Choices/ROX-Filer/PuppyPin
 fi
fi

I added:
Code:
if ! [ $PUPMODE -eq 3 -o $PUPMODE -eq 7 -o $PUPMODE -eq 13 ];then #pup_rw is tmpfs.
 if ! [ "`cat /root/Choices/ROX-Filer/PuppyPin | grep "save2flash"`" = "" ];then
   cat /root/Choices/ROX-Filer/PuppyPin | grep -v "^<icon x=\"768\" y=\"128\" label=\"save\"" >/tmp/PuppyPin-CPY
   cp -f /tmp/PuppyPin-CPY /root/Choices/ROX-Filer/PuppyPin
   echo '</pinboard>' >> /root/Choices/ROX-Filer/PuppyPin
 fi
fi


Is it worth to change?

Thanks,
Rolf

_________________
Ich verwende "frugal", und das ist gut so. Wink
Raspberry Pi without Puppy? No, thanks.
Back to top
View user's profile Send private message 
01micko


Joined: 11 Oct 2008
Posts: 7794
Location: qld

PostPosted: Wed 08 Feb 2012, 05:35    Post subject:  

Hi Rolf..
Quote:
Is it worth to change?

Probably yes!

But it's embedded in woof and getting upstream changes like that are difficult as there are always more pressing issues.

[One example is how gdk-pixbuf-query-loaders is run since gtk+2.20 , I tried to get Barry to change it to the correct call from what I researched but to no avail, I patch it every time I build slacko]

I would do it completely differently...
Code:
case $PUPMODE in
3|7|13)
(code for whatever goes here)
;;
*)echo
;;
esac


Smile

_________________
Woof Mailing List | keep the faith Cool |
Back to top
View user's profile Send private message Visit poster's website 
rhadon


Joined: 27 Mar 2008
Posts: 1291
Location: Germany

PostPosted: Wed 08 Feb 2012, 08:43    Post subject:  

Thanks Mick Very Happy

I wasn't aware about '*)' in case...esac. Will give it a try.

I also know that it's only for one special version. If woof changes (I know it does often Laughing ), everything must be done again and maybe it doesn't work in newer versions or at least it must be changed. Too annoying to do it everytime. But a good feeling to be able to do so and it works. That's the fun. Laughing

Cheers
Rolf

_________________
Ich verwende "frugal", und das ist gut so. Wink
Raspberry Pi without Puppy? No, thanks.
Back to top
View user's profile Send private message 
SkullyRipz

Joined: 02 Mar 2012
Posts: 24

PostPosted: Thu 29 Mar 2012, 23:35    Post subject:  

Bruce...

... thank you. Very Happy This is exactly what I needed. I appreciate all the time spent. Its very well put together and easy to follow.

_________________
Lucid 5.2.8 Frugal
Back to top
View user's profile Send private message 
Display posts from previous:   Sort by:   
Page 8 of 8 [110 Posts]   Goto page: Previous 1, 2, 3, ..., 6, 7, 8
Post new topic   Reply to topic View previous topic :: View next topic
 Forum index » House Training » Users ( For the regulars )
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.0568s ][ Queries: 13 (0.0059s) ][ GZIP on ]