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 Wed 22 Oct 2014, 06:15
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 Posts_count   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: 1293
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: 7832
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_website 
rhadon


Joined: 27 Mar 2008
Posts: 1293
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:   Sort by:   
Page 8 of 8 Posts_count   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:  

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.0653s ][ Queries: 13 (0.0139s) ][ GZIP on ]