Page 1 of 1

'Pause' equivalent in Linux is 'read'

Posted: Wed 22 May 2019, 03:35
by scsijon
Maybe builders and those interested could add a /bin/bash link as /bin/read, it's the equivalent of dos's pause, some nice switces too.

Maybe we should have a stickied topic at the top of the list for things like this to be added, rather than a new one each time?

Posted: Wed 22 May 2019, 09:38
by Lobster
You are right @scsijon :idea:

Not only no pause but no paws command ...
I downloaded xcowsay in BionicPup (Puppy8) with apt-get

Using xcowsay command I was able to get a cow appear on screen
and say 'I don’t think you want to do that Dave'

Code: Select all

xcowsay --time=10 you dont want to do that dave
Puppy also has its own version xpupsay ...
http://puppylinux.info/topic/xpupsay64- ... ed-xcowsay

Now ... what should the paws command do again?
Lobster rambles off into the distance ...

Posted: Wed 22 May 2019, 11:18
by bigpup
read is in Bionicpup64 8.0

Code: Select all

root# read -h
bash: read: -h: invalid option
read: usage: read [-ers] [-a array] [-d delim] [-i text] [-n nchars] [-N nchars] [-p prompt] [-t timeout] [-u fd] [name ...]

Posted: Wed 22 May 2019, 14:42
by rufwoof
Pause with prompt, either waiting 5 seconds or continuing when Enter is pressed

Code: Select all

echo -n "Press Enter or wait 5 seconds : ";read -t 5;echo

Posted: Thu 23 May 2019, 05:07
by phat7
Cutting edge? Is this a joke?

Posted: Thu 23 May 2019, 15:43
by ETP
phat7 wrote:Cutting edge? Is this a joke?
Perhaps cutting edge is not the correct place, but I for one have often missed the Dos pause command.
Whilst aware of the read command, I did not realise that it could be used in the manner described by @ rufwoof.

Lobster wrote:
Not only no pause but no paws command
Your wish is my command so here is @rufwoof's code slightly modified and added to my bash aliases as a paws command

Code: Select all

alias tree="tree -a"
alias myip="curl http://ipecho.net/plain; echo"
alias c="clear"
alias ll="ls -lhA"
alias grep="grep -i --color=auto"
alias df="df -h"
alias free="free -m"
alias paws="echo -n 'Press Enter or wait 90 seconds : ';read -t 90;echo"

Posted: Fri 24 May 2019, 02:32
by Lobster
Thanks @ETP 8)

Great work!

I was thinking of extending it further ...

Some of these may not even be possible, that should not be an obstacle.

PAWS from command line or GUI

- Pause internet connection, this is from my GROWL program

Code: Select all

ifconfig eth0 down
but Puppy runs daemons that reconnect
and wifi is another issue as that is for ethernet.
Probably the safest way is unplug the ethernet cable
(or have a switch on it?)
Also motherboards without wifi are available - wifi in terms of security should be renamed 'iffy'

- Pause computer usage with random suggestion using xcowsay
or xpupsay.
This will stop Linux rabies and other mental health problems for fanatical developers ...
Suggestions might be: 'Tea break?', 'Dog stretch?' (from yoga),
'Leave the Matrix, go for a real world walk!' and so on

- Quantum pause: Entering a state of mindfulness
(as used by Buddhists) without leaving. :roll:

- Hibernate Pause: A form of ghosting, where you are still actively on your computer, whilst going elsewhere.
This may require Iron Mans Jarvis or similar AI :D

Cutting Edge Sanity is now resumed ...

Puppy Linux
Thinking Outside the Boxer

Posted: Thu 18 Jul 2019, 23:27
by scsijon
Lobster wrote:/cut

Now ... what should the paws command do again?
Lobster rambles off into the distance ...
That's easy, race forward by pausing :roll: everything not needed while doing a compile or build. I've just had a package building overnight to find it's still only about halfway through, I had forgot to turn off the network interface!

Posted: Fri 19 Jul 2019, 01:26
by tallboy

Posted: Fri 19 Jul 2019, 08:21
by musher0
Hello all.

Please be aware that some Pups do not have a read utility, only the read function
in bash.

It depends what you want to do:
If you have

Code: Select all

echo "Press Enter key to return to prompt."
read
this will wait until you press the Enter key.

If you have

Code: Select all

echo "Type something and press Enter"
read Something
echo "You have typed '$Something'."
This will wait for your answer and echo in console what you have typed.

If you want execution of routine A to pause for Z seconds (minutes or hours) as tallboy
mentioned, sleep is the utility to use.
E,g,

Code: Select all

sleep 10s
puts the script to sleep for 10 seconds and then resumes execution.

IHTH

Posted: Fri 19 Jul 2019, 09:49
by phat7
musher0 wrote:Please be aware that some Pups do not have a read utility, only the read function
in bash.
Isn't that sufficient? For what a read utility?

Posted: Fri 19 Jul 2019, 23:09
by tallboy
Oh ooh, phat7, here is enough to confuse most of us:
https://linux.die.net/man/2/read
https://linux.die.net/man/3/read
https://www.computerhope.com/unix/bash/read.htm
http://linuxcommand.org/lc3_man_pages/readh.html

Most Puppys use the limited Busybox instead of the full utilities packages, and there is no read in Busybox. There is a read command in my Dpup Stretch, but the explanation of usage is not exactly informative for non-geeks like me!