'Pause' equivalent in Linux is 'read'

For discussions about programming, programming questions/advice, and projects that don't really have anything to do with Puppy.
Post Reply
Message
Author
scsijon
Posts: 1596
Joined: Thu 24 May 2007, 03:59
Location: the australian mallee
Contact:

'Pause' equivalent in Linux is 'read'

#1 Post 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?

User avatar
Lobster
Official Crustacean
Posts: 15522
Joined: Wed 04 May 2005, 06:06
Location: Paradox Realm
Contact:

#2 Post 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 ...
Last edited by Lobster on Wed 22 May 2019, 13:12, edited 1 time in total.
Puppy Raspup 8.2Final 8)
Puppy Links Page http://www.smokey01.com/bruceb/puppy.html :D

User avatar
bigpup
Posts: 13886
Joined: Sun 11 Oct 2009, 18:15
Location: S.C. USA

#3 Post 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 ...]
The things they do not tell you, are usually the clue to solving the problem.
When I was a kid I wanted to be older.... This is not what I expected :shock:
YaPI(any iso installer)

User avatar
rufwoof
Posts: 3690
Joined: Mon 24 Feb 2014, 17:47

#4 Post 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
[size=75]( ͡° ͜ʖ ͡°) :wq[/size]
[url=http://murga-linux.com/puppy/viewtopic.php?p=1028256#1028256][size=75]Fatdog multi-session usb[/url][/size]
[size=75][url=https://hashbang.sh]echo url|sed -e 's/^/(c/' -e 's/$/ hashbang.sh)/'|sh[/url][/size]

phat7
Posts: 179
Joined: Fri 05 Jun 2015, 08:54

#5 Post by phat7 »

Cutting edge? Is this a joke?

User avatar
ETP
Posts: 1193
Joined: Tue 19 Oct 2010, 19:55
Location: UK

#6 Post 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"
Regards ETP
[url=http://tinyurl.com/pxzq8o9][img]https://s17.postimg.cc/tl19y14y7/You_Tube_signature80px.png[/img][/url]
[url=http://tinyurl.com/kennels2/]Kennels[/url]

User avatar
Lobster
Official Crustacean
Posts: 15522
Joined: Wed 04 May 2005, 06:06
Location: Paradox Realm
Contact:

#7 Post 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
Puppy Raspup 8.2Final 8)
Puppy Links Page http://www.smokey01.com/bruceb/puppy.html :D

scsijon
Posts: 1596
Joined: Thu 24 May 2007, 03:59
Location: the australian mallee
Contact:

#8 Post 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!

User avatar
tallboy
Posts: 1760
Joined: Tue 21 Sep 2010, 21:56
Location: Drøbak, Norway

#9 Post by tallboy »

True freedom is a live Puppy on a multisession CD/DVD.

musher0
Posts: 14629
Joined: Mon 05 Jan 2009, 00:54
Location: Gatineau (Qc), Canada

#10 Post 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
musher0
~~~~~~~~~~
"You want it darker? We kill the flame." (L. Cohen)

phat7
Posts: 179
Joined: Fri 05 Jun 2015, 08:54

#11 Post 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?

User avatar
tallboy
Posts: 1760
Joined: Tue 21 Sep 2010, 21:56
Location: Drøbak, Norway

#12 Post 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!
Attachments
read-help.jpg
(114.9 KiB) Downloaded 128 times
True freedom is a live Puppy on a multisession CD/DVD.

Post Reply