Page 4 of 8

Re: double ampersand

Posted: Thu 09 Dec 2010, 23:22
by RetroTechGuy
don570 wrote:I think I learned about the double ampersand when
I read a book about Unix a couple of years ago.
Linux does things different obviously.
I think I learned that under SunOS (erm...a couple decades ago)... Which also worked under Slackware, Debian, etc...
When in Rome do as the Romans do.
When incognito, do as the cognito do... :lol:

double ampersand

Posted: Fri 10 Dec 2010, 01:31
by don570
I remember now . I was installing netbsd unix
on an old mac computer and I started
reading about unix.

Here's the reference

Visual Quickstart Guide
Unix Third Edition

by Deborah S. Ray and Eric J. Ray

Code: Select all

If you use && to combine commands,
the system will run both in sequence but
run the second only if the first succeeds.
For example, you could use 

mv  todolist  todolist.done  &&  touch todolist 

to move your to-do list to a different file and
create a new to-do list.  If the first command 
fails  (for example, because you don't have 
permission to create a new file),  the second 
command won't run.
With Puppy linux there isn't many permissions issues,
so nobody uses the double ampersand.
Now I understand the confusion.
_______________________________________

Re: double ampersand

Posted: Fri 10 Dec 2010, 16:46
by RetroTechGuy
don570 wrote:I remember now . I was installing netbsd unix
on an old mac computer and I started
reading about unix.

Here's the reference

Visual Quickstart Guide
Unix Third Edition

by Deborah S. Ray and Eric J. Ray

Code: Select all

If you use && to combine commands,
the system will run both in sequence but
run the second only if the first succeeds.
For example, you could use 

mv  todolist  todolist.done  &&  touch todolist 

to move your to-do list to a different file and
create a new to-do list.  If the first command 
fails  (for example, because you don't have 
permission to create a new file),  the second 
command won't run.
Aha! That's a valid reason to have such a command, in addition to ";" (which runs regardless)

I learned something new today! Thanks Don!
With Puppy linux there isn't many permissions issues,
so nobody uses the double ampersand.
Now I understand the confusion.
Well, most people don't even use the command line any more, so...

I guess that I was aware that "&&" also worked, but because "&" is a "special character", I avoided it. From the error standpoint, I find that ";" is more well behaved -- and when it doesn't work, it doesn't do exceptionally strange things -- like backgrounding jobs... :wink:

BTW, it rather looked like part of the problem was that characters we being "quoted" rather than being operators...

There's that whole goofy list of special characters, such as: "&" versus "\&" and what's the really goofy one..."\\" which quotes "" as a character (I _think_)? ("" being the special character used for quoting, is difficult to "quote", so you have to "quote" it again...or is it twice more?)

Urgh!!!...

Re: double ampersand

Posted: Fri 10 Dec 2010, 18:54
by jpeps
RetroTechGuy wrote:
don570 wrote:I remember now . I was installing netbsd unix
on an old mac computer and I started
reading about unix.

Here's the reference

Visual Quickstart Guide
Unix Third Edition

by Deborah S. Ray and Eric J. Ray

Code: Select all

If you use && to combine commands,
the system will run both in sequence but
run the second only if the first succeeds.
For example, you could use 

mv  todolist  todolist.done  &&  touch todolist 

to move your to-do list to a different file and
create a new to-do list.  If the first command 
fails  (for example, because you don't have 
permission to create a new file),  the second 
command won't run.
Aha! That's a valid reason to have such a command, in addition to ";" (which runs regardless)

I learned something new today! Thanks Don!
With Puppy linux there isn't many permissions issues,
so nobody uses the double ampersand.
Now I understand the confusion.
Mostly I see "&&" used after after tests. If using ";" it's just a new line of code....quite different.

Code: Select all

[ "$1" = "" ] && echo "no arguments here" && exit 

Posted: Sun 23 Jan 2011, 13:18
by zigbert
Version 0.9-3
See main post

Changelog
- New parameters to manage Pschedule from external apps
--> -e : edit a already defined command
--> -s : run silent. Do not show main window.

This makes it possible to use the Pschedule editor in other apps. Will be used by Pmusic 1.6.0

Posted: Tue 15 Feb 2011, 13:40
by zigbert
Version 1.0
See main post

Changelog
- Faster startup
- Language support
- Reorganized main gui
- Different outfit for fields that user edits and those pSchedule edits.

bad install in wary quickset 503

Posted: Tue 08 Mar 2011, 20:15
by don570
There was a bad install of pschedule in wary quickset 503.

I've warned shinobar
http://www.murga-linux.com/puppy/viewto ... 377#502377

To prevent this from happening again, it might be helpful to
change the .desktop file

Code: Select all

[Desktop Entry]
Encoding=UTF-8
Name=Pschedule task on time
Icon=mini-clock.xpm
Comment=Pschedule task on time
Exec=/usr/local/pschedule/pschedule
Terminal=false
Type=Application
Categories=X-SystemSchedule
GenericName=Pschedule task on time
I would suggest changing the line
Exec=/usr/local/pschedule/pschedule

to

Code: Select all

Exec=/usr/local/bin/pschedule

That will force users to install properly or it won't work at all.

___________________________________

Posted: Sat 12 Mar 2011, 17:43
by zigbert
done


Thanks
Sigmund

Posted: Sun 20 Mar 2011, 08:13
by zigbert
Version 1.0.1
See main post


Changelog
- Bugfix: Detect macrolanguage (fr, en..) when lang contains utf or similar post info.
- Bugfix: translation of 'task' and 'time' in editor (thanks to etiennep)
- Bugfix: Exec-path in .desktop file (thanks to don570)
- Bugfix: Troubles after unstalling NLS. (thanks to shinobar) --> see line 46 pmusic
- NLS_ Added: $Time

pschedule 101

Posted: Sat 02 Apr 2011, 18:30
by don570
Using lucid puppy 5.2.......


I couldn't get pschedule 1.0.1 to show in French
so I had to stick with pschedule 1.0

_______________________________

Also I recommend that you change the name of
'fr_ca:french' to 'fr:french'

This will make the application show in French
without the need to create a link.

______________________________

Re: pschedule 101

Posted: Sat 16 Apr 2011, 18:47
by zigbert
don570 wrote:Using lucid puppy 5.2.......


I couldn't get pschedule 1.0.1 to show in French
so I had to stick with pschedule 1.0

_______________________________

Also I recommend that you change the name of
'fr_ca:french' to 'fr:french'

This will make the application show in French
without the need to create a link.

______________________________
Got it - added to todo-list


Sigmund

Posted: Mon 25 Apr 2011, 22:55
by Geoffrey
Thanks for this, one small problem, if I can call it that, the link buttons in the about box didn't work for me.
I added BROWSER="defaultbrowser" to the top of the pschedule script and that fixed it.

Posted: Wed 27 Apr 2011, 19:17
by zigbert
Geoffrey
Got it, thank you


Sigmund

APPDIR >> PROGPATH

Posted: Thu 02 Jun 2011, 18:36
by rodin.s
Localization does not work. In /usr/local/pschedule/pschedule $APPDIR should be replaced with $PROGPATH.

Re: APPDIR >> PROGPATH

Posted: Fri 03 Jun 2011, 18:48
by zigbert
rodin.s wrote:Localization does not work. In /usr/local/pschedule/pschedule $APPDIR should be replaced with $PROGPATH.
Thank you. Don570 complained about this ages ago, and I have simply forgotten. Sorry.


Sigmund

Posted: Fri 03 Jun 2011, 18:54
by zigbert
Version 1.0.2
See main post

- Bugfix: View webpages from About-dialog (thanks to Geoffrey)
- Bugfix: Language detection (rodin.s)

Posted: Sat 04 Jun 2011, 06:26
by zigbert
bump

backup a pupsave file

Posted: Sat 24 Sep 2011, 19:15
by don570
I describe how to backup a pupsave file at a scheduled time
at this page
http://www.murga-linux.com/puppy/viewto ... 279#567279

_________________________________________________

Puppy Backup

Posted: Thu 03 May 2012, 23:06
by don570
I wrote about using Pschedule with Puppy Backup
HERE

This method will allow the user to back up his favorite folders overnite
on a regular basis.

It's quite simple and it just needs enough hard disk space
for the mirroring to be done completely and keep your
computer on overnite.

An external USB hard drive would be good for this purpose
and they're quite cheap now.

Mirroring of an entire partition to a folder is possible.

Make sure that the mirror folder is initially empty.

______________________________________________

Posted: Fri 20 Jul 2012, 00:20
by don570
Is it possible to filter out crond lines that begin with #
i.e. are obvious comments.

I'm trying to use pschedule with Porteus distribution
and it works surprising well except for all the comments.

I tried the following line to filter them out in
line 13 of func_cron_to_human

Code: Select all

	cat /var/spool/cron/crontabs/$USER | sed "/^#/d" | sed -e "s/ /{ð®SSSđþ}/g" | sed -e "s/*/{ð®STARđþ}/g" > /tmp/pschedule-forloop
However I found that Delete key wouldn't work which is
important to me.

_______________________________________________