Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.debian.user > #194968
| From | john doe <johndoe65534@mail.com> |
|---|---|
| Newsgroups | linux.debian.user |
| Subject | Re: encryption |
| Date | 2018-04-22 08:30 +0200 |
| Message-ID | <vHgFA-if-5@gated-at.bofh.it> (permalink) |
| References | <vGK2Z-3Dx-1@gated-at.bofh.it> <vGOgh-6Fy-5@gated-at.bofh.it> <vH2CB-7Gd-5@gated-at.bofh.it> <vH2Mi-7JM-15@gated-at.bofh.it> <vH6PU-1SK-15@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
On 4/21/2018 9:58 PM, David Christensen wrote: > On 04/21/18 08:38, john doe wrote: >> Here's the code I used to let a script prompt for a password: >> >> read -s -p "Enter password: " >> [ $? -ne 0 ] && exit 1 > > Note that the above 'read' command will operate differently on Dash and > on Bash: > > 2018-04-21 12:53:27 dpchrist@vstretch ~/sandbox/sh > $ cat read > read -s -p "Enter password: " > [ $? -ne 0 ] && exit 1 > echo > echo $REPLY > > 2018-04-21 12:54:03 dpchrist@vstretch ~/sandbox/sh > $ dash read > read: 1: read: Illegal option -s > > 2018-04-21 12:54:06 dpchrist@vstretch ~/sandbox/sh > $ bash read > Enter password: > secret > > > Shell scripts using lowest-common denominator Bourne shell syntax are > the most portable. When I start getting fancy with Bash, I switch to Perl. > Thanks David, for pointing out that bit of code won't work in Dash! That's one of the reasons I have redone all of my scripts to have them POSIX compliant while keeping portability a priority! :) I only speak shell scripting, how would you do that in Perl? -- John Doe
Back to linux.debian.user | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
encryption Brian <ad44@cityscape.co.uk> - 2018-04-20 21:40 +0200
Re: encryption Greg Wooledge <wooledg@eeg.ccf.org> - 2018-04-20 22:00 +0200
Re: encryption David Christensen <dpchrist@holgerdanske.com> - 2018-04-21 02:10 +0200
Re: encryption Brian <ad44@cityscape.co.uk> - 2018-04-21 17:30 +0200
Re: encryption john doe <johndoe65534@mail.com> - 2018-04-21 17:40 +0200
Re: encryption David Christensen <dpchrist@holgerdanske.com> - 2018-04-21 22:00 +0200
Re: encryption john doe <johndoe65534@mail.com> - 2018-04-22 08:30 +0200
Re: encryption David Christensen <dpchrist@holgerdanske.com> - 2018-04-22 20:30 +0200
Re: encryption Glenn English <ghe2001@gmail.com> - 2018-04-21 19:00 +0200
Re: encryption David Christensen <dpchrist@holgerdanske.com> - 2018-04-21 22:30 +0200
Re: encryption David Christensen <dpchrist@holgerdanske.com> - 2018-04-21 21:50 +0200
Re: encryption David Wright <deblis@lionunicorn.co.uk> - 2018-04-22 18:20 +0200
Re: encryption Brian <ad44@cityscape.co.uk> - 2018-04-22 18:50 +0200
Re: encryption David Wright <deblis@lionunicorn.co.uk> - 2018-04-23 10:50 +0200
Re: encryption Brian <ad44@cityscape.co.uk> - 2018-04-23 13:20 +0200
Re: encryption David Wright <deblis@lionunicorn.co.uk> - 2018-04-24 20:50 +0200
Re: encryption David Wright <deblis@lionunicorn.co.uk> - 2018-04-21 18:40 +0200
Re: encryption Brian <ad44@cityscape.co.uk> - 2018-04-21 20:20 +0200
Re: encryption David Wright <deblis@lionunicorn.co.uk> - 2018-04-21 21:00 +0200
Re: encryption Brian <ad44@cityscape.co.uk> - 2018-04-21 21:20 +0200
Re: encryption David Christensen <dpchrist@holgerdanske.com> - 2018-04-21 23:30 +0200
Re: encryption David Wright <deblis@lionunicorn.co.uk> - 2018-04-22 04:30 +0200
Re: encryption Curt <curty@free.fr> - 2018-04-22 11:20 +0200
Re: encryption Reco <recoverym4n@gmail.com> - 2018-04-22 11:50 +0200
Re: encryption Brian <ad44@cityscape.co.uk> - 2018-04-22 19:10 +0200
Re: encryption David Christensen <dpchrist@holgerdanske.com> - 2018-04-21 22:50 +0200
Re: encryption David Christensen <dpchrist@holgerdanske.com> - 2018-04-21 22:10 +0200
Re: encryption David Wright <deblis@lionunicorn.co.uk> - 2018-04-22 04:00 +0200
Re: encryption Brian <ad44@cityscape.co.uk> - 2018-04-22 17:40 +0200
Re: encryption Richard Hector <richard@walnut.gen.nz> - 2018-04-23 08:00 +0200
Re: encryption Andrew McGlashan <andrew.mcglashan@affinityvision.com.au> - 2018-04-23 09:00 +0200
Re: encryption David Christensen <dpchrist@holgerdanske.com> - 2018-04-22 20:10 +0200
csiph-web