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 Tue 23 Jul 2019, 02:50
All times are UTC - 4
 Forum index » Off-Topic Area » Programming
'Pause' equivalent in Linux is 'read'
Post new topic   Reply to topic View previous topic :: View next topic
Page 1 of 1 [12 Posts]  
Author Message
scsijon

Joined: 23 May 2007
Posts: 1447
Location: the australian mallee

PostPosted: Tue 21 May 2019, 23:35    Post subject:  'Pause' equivalent in Linux is 'read'  

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?
Back to top
View user's profile Send private message Visit poster's website 
Lobster
Official Crustacean


Joined: 04 May 2005
Posts: 15449
Location: Paradox Realm

PostPosted: Wed 22 May 2019, 05:38    Post subject:    

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:
xcowsay --time=10 you dont want to do that dave


Puppy also has its own version xpupsay ...
http://puppylinux.info/topic/xpupsay64-tahrpup606-repackaged-xcowsay

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

_________________
Raspberry Pi 4 to run Puppi
NEW BusterPup Beta - test now

Last edited by Lobster on Wed 22 May 2019, 09:12; edited 1 time in total
Back to top
View user's profile Send private message Visit poster's website 
bigpup


Joined: 11 Oct 2009
Posts: 12344
Location: S.C. USA

PostPosted: Wed 22 May 2019, 07:18    Post subject:  

read is in Bionicpup64 8.0

Code:
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 Shocked
YaPI(any iso installer) http://www.murga-linux.com/puppy/viewtopic.php?t=107601
Back to top
View user's profile Send private message 
rufwoof


Joined: 24 Feb 2014
Posts: 3254

PostPosted: Wed 22 May 2019, 10:42    Post subject:  

Pause with prompt, either waiting 5 seconds or continuing when Enter is pressed
Code:
echo -n "Press Enter or wait 5 seconds : ";read -t 5;echo

_________________
( ͡° ͜ʖ ͡°) :wq
Fatdog multi-session usb

echo url|sed -e 's/^/(c/' -e 's/$/ hashbang.sh)/'|sh
Back to top
View user's profile Send private message 
phat7

Joined: 05 Jun 2015
Posts: 138

PostPosted: Thu 23 May 2019, 01:07    Post subject:  

Cutting edge? Is this a joke?
Back to top
View user's profile Send private message 
ETP


Joined: 19 Oct 2010
Posts: 1159
Location: UK

PostPosted: Thu 23 May 2019, 11:43    Post subject:  

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:
Quote:
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:
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

Kennels
Back to top
View user's profile Send private message 
Lobster
Official Crustacean


Joined: 04 May 2005
Posts: 15449
Location: Paradox Realm

PostPosted: Thu 23 May 2019, 22:32    Post subject:  

Thanks @ETP Cool

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:
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. Rolling Eyes

- 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 Very Happy

Cutting Edge Sanity is now resumed ...

Puppy Linux
Thinking Outside the Boxer

_________________
Raspberry Pi 4 to run Puppi
NEW BusterPup Beta - test now
Back to top
View user's profile Send private message Visit poster's website 
scsijon

Joined: 23 May 2007
Posts: 1447
Location: the australian mallee

PostPosted: Thu 18 Jul 2019, 19:27    Post subject:  

Lobster wrote:
/cut

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


That's easy, race forward by pausing Rolling Eyes 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!
Back to top
View user's profile Send private message Visit poster's website 
tallboy


Joined: 21 Sep 2010
Posts: 1387
Location: Drøbak, Norway

PostPosted: Thu 18 Jul 2019, 21:26    Post subject:  

https://linux.die.net/man/1/sleep
_________________
True freedom is a live Puppy on a multisession CD/DVD.
Back to top
View user's profile Send private message 
musher0

Joined: 04 Jan 2009
Posts: 14233
Location: Gatineau (Qc), Canada

PostPosted: Fri 19 Jul 2019, 04:21    Post subject:  

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:
echo "Press Enter key to return to prompt."
read
this will wait until you press the Enter key.

If you have
Code:
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:
sleep 10s
puts the script to sleep for 10 seconds and then resumes execution.

IHTH

_________________
musher0
~~~~~~~~~~
Je suis né pour aimer et non pas pour haïr. (Sophocle) /
I was born to love and not to hate. (Sophocles)
Back to top
View user's profile Send private message 
phat7

Joined: 05 Jun 2015
Posts: 138

PostPosted: Fri 19 Jul 2019, 05:49    Post subject:  

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?
Back to top
View user's profile Send private message 
tallboy


Joined: 21 Sep 2010
Posts: 1387
Location: Drøbak, Norway

PostPosted: Fri 19 Jul 2019, 19:09    Post subject:  

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!
read-help.jpg
 Description   
 Filesize   114.9 KB
 Viewed   21 Time(s)

read-help.jpg


_________________
True freedom is a live Puppy on a multisession CD/DVD.
Back to top
View user's profile Send private message 
Display posts from previous:   Sort by:   
Page 1 of 1 [12 Posts]  
Post new topic   Reply to topic View previous topic :: View next topic
 Forum index » Off-Topic Area » Programming
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.0543s ][ Queries: 12 (0.0064s) ][ GZIP on ]