Controlling user input


Login or Register for Dates, Times and to Reply

 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Controlling user input
# 8  
Nice idea Corona668 .

I don't have access to MacOS, I'm amazed the most recent releases ship with a 12 year old shell (whats going on there). Checking the exit status of read after the stty command appears to work OK in bash 4.4.12 and 5.0.7

Code:
# Timeout is 1/10 of a second, minimum read is 0 characters
stty -icanon min 0 time 1

# Continue until read finds nothing
while read 2> /dev/null ; do : ; done

# Reset terminal to normal
stty sane

I found the redirect of stderr necessary because cygwin sometimes reports read: read error: 0: Resource temporarily unavailable, but I never caught it not flushing all the input.
This User Gave Thanks to Chubler_XL For This Post:
# 9  
Cygwin has been known to do that with fork() too, occasionally. Run a big long-lived make and you might see it. Something in the Windows kernel just doesn't like lots of short-lived reads or forks in close succession.
# 10  
Minor comment

Hi.
Quote:
Originally Posted by Chubler_XL
Nice idea Corona668 .

I don't have access to MacOS, I'm amazed the most recent releases ship with a 12 year old shell (whats going on there). ...
I seem to recall that Apple will ship zsh as the default shell in the future, so perhaps they don't really care about the old bash version (but will likely supply bash to avoid breaking extant scripts) ... cheers, drl

Last edited by drl; 08-30-2019 at 09:48 AM..
# 11  
Some say this is the reason that Apple ships with an older version of bash:

Reference:

GNU General Public License - Wikipedia

Quote:
Legal barrier to app stores

The GPL License is incompatible with many application digital distribution systems, like the Mac App Store, and certain other software distribution platforms (on smartphones as well as PCs). The problem lies in the right "To make a copy for your neighbour", as this right is violated by digital rights management systems embedded within the platform to prevent copying of paid software. Even if the application is free in the App Store in question, it might result in a violation of that app store's terms.

Note that there is a distinction between an app store, which sells DRM-restricted software under proprietary licenses, and the more general concept of digital distribution via some form of online software repository. Various UNIX-like distributions provide app repositories, including Fedora, RHEL, CentOS, Ubuntu, Debian, FreeBSD, OpenBSD and so on. These specific app repos all contain GPL-licensed software apps, in some cases even when the core project does not permit GPL-licensed code in the base system (for instance OpenBSD). In other cases, such as the Ubuntu App Store, proprietary commercial software applications and GPL-licensed applications are both available via the same system; the reason that the Mac App Store (and similar projects) is incompatible with GPL-licensed apps is not inherent in the concept of an app store, but is rather specifically due to Apple's terms-of-use requirement[130] that all apps in the store utilize Apple DRM-restrictions. Ubuntu's app store does not demand any such requirement: "These terms do not limit or restrict your rights under any applicable open source software licenses."
So, try updating using brew:

Code:
MBA_NOW:~ Tim$ bash --version
GNU bash, version 3.2.57(1)-release (x86_64-apple-darwin18)
Copyright (C) 2007 Free Software Foundation, Inc.

Code:
MBA_NOW:~ Tim$ brew install bash
Updating Homebrew...
==> Installing dependencies for git: pcre2
==> Installing git dependency: pcre2
==> Downloading https://homebrew.bintray.com/bottles/pcre2-10.33.mojave.bottle.tar.gz
==> Downloading from https://akamai.bintray.com/fb/fb30c3eebba4483a10378bc8df52f96761fed4a1ac5572ad1bf4afbf2f8638c5?__gd
######################################################################## 100.0%
==> Pouring pcre2-10.33.mojave.bottle.tar.gz
������  /usr/local/Cellar/pcre2/10.33: 226 files, 5.7MB
==> Installing git
==> Downloading https://homebrew.bintray.com/bottles/git-2.22.0.mojave.bottle.tar.gz
==> Downloading from https://akamai.bintray.com/b1/b11303a919ad9bbde26d12dd5a67b3ee94a6204a631b0aa6b49c7d174ce37069?__gd
######################################################################## 100.0%
==> Pouring git-2.22.0.mojave.bottle.tar.gz
==> Caveats
Bash completion has been installed to:
  /usr/local/etc/bash_completion.d

zsh completions and functions have been installed to:
  /usr/local/share/zsh/site-functions

Emacs Lisp files have been installed to:
  /usr/local/share/emacs/site-lisp/git
==> Summary
������  /usr/local/Cellar/git/2.22.0: 1,531 files, 43.6MB
==> `brew cleanup` has not been run in 30 days, running now...
xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
==> Caveats
==> git
Bash completion has been installed to:
  /usr/local/etc/bash_completion.d

zsh completions and functions have been installed to:
  /usr/local/share/zsh/site-functions

Emacs Lisp files have been installed to:
  /usr/local/share/emacs/site-lisp/git
xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
==> Auto-updated Homebrew!
Updated 2 taps (homebrew/core and homebrew/cask).
==> New Formulae
anime-downloader    contentful-cli      grpc-swift          lerna               nushell             shadowenv
antibody            cpl                 helmsman            libevhtp            octant              starship
asyncplusplus       cpu_features        janet               libsixel            openkim-models      tflint
aws-google-auth     cxxopts             k3d                 libspng             pdftk-java          whalebrew
bazelisk            devspace            k6                  libvncserver        pokerstove          wtfutil
benthos             dhall-bash          kim-api             mariadb@10.3        protobuf@3.7        yapf
bitwise             dive                kubebuilder         netlify-cli         pulp                zrepl
borgmatic           gatsby-cli          lazydocker          now-cli             quickjs
==> Updated Formulae
cairo ✔                                 grpc                                    opencv@2
cmake ✔                                 grpcurl                                 opencv@3
dbus ✔                                  grsync                                  openfortivpn
freetype ✔                              gsmartcontrol                           openh264
gettext ✔                               gsoap                                   openhmd
git ✔                                   gspell                                  openimageio
glib ✔                                  gst-editing-services                    openldap
gnutls ✔                                gst-libav                               openrct2
gobject-introspection ✔                 gst-plugins-bad                         opensaml
harfbuzz ✔                              gst-plugins-base                        opensc
jsoncpp ✔                               gst-plugins-good                        openshift-cli
libtasn1 ✔                              gst-plugins-ugly                        openslide
mtr ✔                                   gst-python                              openssh
mysql ✔                                 gst-rtsp-server                         opensubdiv
nmap ✔                                  gst-validate                            openttd
node ✔                                  gstreamer                               operator-sdk
numpy ✔                                 gstreamermm                             ophcrack
opencv ✔                                gtk+                                    orbit
pango ✔                                 gtk+3                                   orc
python ✔                                gtk-chtheme                             orc-tools
rrdtool ✔                               gtk-doc                                 ori
sdl2 ✔                                  gtk-gnutella                            osc
sdl2_image ✔                            gtk-mac-integration                     oscats
sqlite ✔                                gtk-vnc                                 osm-gps-map
webp ✔                                  gtkdatabox                              osquery
wireshark ✔                             gtkextra                                overmind
abcm2ps                                 gtkglext                                oxipng
abcmidi                                 gtkmm                                   p7zip
abyss                                   gtkmm3                                  packer
ace                                     gtksourceview                           packer-completion
ack                                     gtksourceview3                          pagmo
acpica                                  gtksourceview4                          paket
activemq-cpp                            gtksourceviewmm                         pandoc-citeproc
afflib                                  gtksourceviewmm3                        pangomm
agda                                    gtkspell3                               paps
agedu                                   gtmess                                  parallel
aircrack-ng                             gts                                     passenger
algernon                                gucharmap                               pazpar2
aliyun-cli                              guile                                   pc6001vx
alot                                    gupnp-av                                pcb
alpine                                  gupnp-tools                             pcb2gcode
amap                                    gwenhywfar                              pcsc-lite
amazon-ecs-cli                          gwyddion                                pdf2htmlex
ammonite-repl                           gxml                                    pdf2svg
amqp-cpp                                h2o                                     pdfcrack
amtk                                    h3                                      pdfpc
angband                                 hadolint                                pdftoipe
angle-grinder                           hamlib                                  pdns
angular-cli                             hapi-fhir-cli                           pdnsrec
anjuta                                  haproxy                                 peg-markdown
annie                                   hashcat                                 pegtl
ansible                                 haskell-stack                           perltidy
ansiweather                             hbase                                   petsc
anycable-go                             hcloud                                  petsc-complex
apache-arrow                            heimdal                                 pev
apache-arrow-glib                       helmfile                                pgbadger
apache-flink                            help2man                                pgbouncer
apib                                    herrie                                  pgroonga
app-engine-python                       hfstospell                              pgweb
apt-dater                               hidapi                                  php
aptly                                   highlight                               php@7.1
aqbanking                               hive                                    php@7.2
arangodb                                hlint                                   phpmd
argon2                                  homeassistant-cli                       phpstan
armadillo                               homebank                                phpunit
armor                                   hqx                                     picard-tools
arpack                                  htpdate                                 pidgin
arping                                  http_load                               pinboard-notes-backup
artifactory                             httpd                                   pinfo
asciidoctor                             httping                                 pioneer
asciidoctorj                            httrack                                 pioneers
asdf                                    hub                                     pius
ask-cli                                 hugo                                    pjproject
aspell                                  hunspell                                planck
astrometry-net                          hwloc                                   plantuml
atk                                     hydra                                   platformio
atkmm                                   hyperkit                                platypus
atlantis                                hyperscan                               plplot
atomist-cli                             hypre                                   pmd
ats2-postiats                           i2p                                     pms
audacious                               i2pd                                    png++
auditbeat                               i386-elf-gcc                            pngquant
autorest                                i386-elf-gdb                            poco
avfs                                    i386-elf-grub                           podofo
awf                                     icecast                                 pony-stable
aws-okta                                idris                                   ponyc
aws-sdk-cpp                             igv                                     poppler
awscli                                  ike-scan                                postgis
axel                                    imagemagick                             postgresql
azure-cli                               imagemagick@6                           postgresql@10
azure-storage-cpp                       imageoptim-cli                          postgresql@9.4
babel                                   imapfilter                              postgresql@9.5
babeld                                  influxdb                                postgresql@9.6
babl                                    inlets                                  postgrest
bacula-fd                               insect                                  pqiv
balena-cli                              interactive-rebase-tool                 pre-commit
baobab                                  internetarchive                         prefixsuffix
bareos-client                           ios-webkit-debug-proxy                  presto
basex                                   iperf                                   prips
bash                                    iperf3                                  procs
bazel                                   ipfs                                    procyon-decompiler
bbftp-client                            ipopt                                   profanity
beanstalkd                              ipython                                 proftpd
bear                                    ircd-hybrid                             proguard
bettercap                               ircii                                   proj
bgpstream                               irssi                                   prometheus
bibtexconv                              iso-codes                               proteinortho
bigloo                                  ispc                                    protobuf
binaryen                                istioctl                                protobuf-c
bind                                    isync                                   protobuf-swift
bindfs                                  jadx                                    protoc-gen-go
bit                                     jboss-forge                             prototool
bitcoin                                 jdupes                                  pspg
bitlbee                                 jemalloc                                pulledpork
bitrise                                 jenkins                                 pulumi
black                                   jenkins-lts                             pure-ftpd
blink1                                  jetty                                   pushpin
blueutil                                jfrog-cli-go                            putty
bookloupe                               jhead                                   puzzles
botan                                   jhipster                                pwsafe
breezy                                  jigdo                                   py2cairo
bro                                     jing-trang                              pybind11
btfs                                    jinja2-cli                              pyenv
btparse                                 jlog                                    pygobject3
btpd                                    jnettop                                 pygtk
buildifier                              joplin                                  pygtkglext
buildkit                                jose                                    pygtksourceview
bundletool                              jruby                                   pyinstaller
burp                                    jsdoc3                                  pypy3
byacc                                   json-fortran                            pyside
byobu                                   json-glib                               python-markdown
bzip2                                   juju                                    pyvim
bzt                                     jvgrep                                  qalculate-gtk
c-blosc                                 kafka                                   qemu
cabal-install                           kallisto                                qmmp
cadaver                                 kapacitor                               qpid-proton
caddy                                   kibana                                  qrupdate
caf                                     klavaro                                 qt
caffe                                   knot                                    quantlib
cake                                    kobalt                                  r
calcurse                                kops                                    rabbitmq
calicoctl                               kore                                    radare2
camlp4                                  kotlin                                  rakudo
camlp5                                  krb5                                    rbspy
cargo-completion                        ktlint                                  rclone
cash-cli                                kube-aws                                rdesktop
cataclysm                               kubecfg                                 rdup
catch2                                  kubeless                                re-flex
catimg                                  kubeprod                                re2
cattle                                  kubernetes-cli                          re2c
ccache                                  kubernetes-helm                         reattach-to-user-namespace
center-im                               kubernetes-service-catalog-client       rebar3
ceres-solver                            kubeseal                                recode
certbot                                 kustomize                               recon-ng
cf4ocl                                  kvazaar                                 redex
cfengine                                lablgtk                                 redo
cfn-lint                                lammps                                  redshift
cfr-decompiler                          landscaper                              redsocks
cfssl                                   languagetool                            remarshal
cgdb                                    lasi                                    remctl
cgit                                    lasso                                   repo
cgrep                                   latexml                                 reposurgeon
chafa                                   launchdns                               rex
chakra                                  lazygit                                 riemann
chamber                                 ldapvi                                  ripgrep
checkbashisms                           ldc                                     rke
checkstyle                              ldid                                    rmlint
chicken                                 ldns                                    robot-framework
chipmunk                                lean-cli                                rocksdb
chrome-export                           lego                                    rom-tools
chronograf                              lensfun                                 root
cimg                                    lf                                      roswell
circleci                                lftp                                    rpm
citus                                   lgogdownloader                          rpm2cpio
cjdns                                   libbi                                   rsyslog
ckan                                    libbitcoin                              rtags
clamav                                  libbitcoin-blockchain                   rtv
clhep                                   libbitcoin-client                       ruby-build
click                                   libbitcoin-consensus                    rush
clingo                                  libbitcoin-database                     rust
clojure                                 libbitcoin-explorer                     s-nail
clozure-cl                              libbitcoin-network                      s3-backer
clutter                                 libbitcoin-node                         s3ql
clutter-gst                             libbitcoin-protocol                     s6
clutter-gtk                             libbitcoin-server                       saldl
cmix                                    libbluray                               sane-backends
cmus                                    libchamplain                            sassc
cnats                                   libcouchbase                            saxon
cockroach                               libcroco                                sbcl
cocoapods                               libdap                                  scala@2.12
cogl                                    libdazzle                               scalapack
cointop                                 libdvbpsi                               scamper
collectd                                libebml                                 sccache
commandbox                              libev                                   scdoc
composer                                libevent                                sceptre
conan                                   libexosip                               schismtracker
consul                                  libfabric                               scipy
consul-template                         libfaketime                             scons
convox                                  libfixbuf                               scrcpy
corectl                                 libfreefare                             scrollkeeper
coturn                                  libgda                                  sd
cpansearch                              libgdata                                sdcv
cppcheck                                libgee                                  sdlpop
cpprestsdk                              libgig                                  ser2net
cql                                     libgit2                                 serverless
cracklib                                libglade                                sf-pwgen
credstash                               libglademm                              sflowtool
creduce                                 libgnomecanvas                          shadowsocks-libev
cromwell                                libgnomecanvasmm                        shared-mime-info
crosstool-ng                            libgphoto2                              shc
crowdin                                 libgsf                                  shellcheck
crystal                                 libgtop                                 shellharden
crystal-icr                             libgweather                             shibboleth-sp
csound                                  libhdhomerun                            ship
csvq                                    libheif                                 shogun
curl                                    libhttpseverywhere                      siege
curl-openssl                            libical                                 silk
curlftpfs                               libidl                                  simple-tiles
cutter                                  libidn2                                 sip
cython                                  libimagequant                           sipp
dartsim                                 libinfinity                             siril
datetime-fortran                        libiodbc                                sispmctl
dav1d                                   libiptcdata                             sk
davix                                   libiscsi                                skaffold
davmail                                 libjson-rpc-cpp                         skinny
dbhash                                  libjwt                                  skktools
dbus-glib                               liblcf                                  skopeo
dc3dd                                   liblqr                                  sleepwatcher
dcd                                     liblunar                                sleuthkit
dcmtk                                   libmaa                                  sn0int
deark                                   libmatio                                snakemake
debianutils                             libmatroska                             snapcraft
dehydrated                              libmodbus                               snownews
deno                                    libmowgli                               sofia-sip
dep                                     libmp3splt                              solarus
dependency-check                        libmpd                                  solr
desktop-file-utils                      libmpdclient                            sonar-scanner
dfc                                     libmypaint                              sonarqube
dhall                                   libnice                                 sonobuoy
dhall-json                              libnids                                 sourcekitten
di                                      libnotify                               sourcery
dialog                                  libomp                                  spdylay
diamond                                 libopenmpt                              speedtest-cli
diff-pdf                                libosinfo                               sphinx
diff-so-fancy                           libosip                                 sphinx-doc
diffoscope                              libosmium                               spice-protocol
digdag                                  libpeas                                 spim
direvent                                libphonenumber                          spin
distcc                                  libpq                                   spirv-cross
dita-ot                                 libpqxx                                 sqlcipher
django-completion                       libpst                                  sqldiff
dmd                                     libpulsar                               sqlite-analyzer
dnscrypt-wrapper                        libqalculate                            sqlmap
dnsperf                                 libquicktime                            squid
dnstwist                                libraw                                  src
docfx                                   librdkafka                              srt
docker                                  libre                                   sshfs
docker-completion                       librealsense                            sshguard
docker-compose                          librem                                  sslsplit
docker-compose-completion               librest                                 sstp-client
docker-credential-helper                librsvg                                 stanford-parser
docker-credential-helper-ecr            librsync                                stella
doctl                                   libsass                                 stellar-core
docutils                                libsbol                                 step
doitlive                                libsecret                               stern
dopewars                                libshout                                stolon
dosbox                                  libsignal-protocol-c                    storm
dovecot                                 libsmf                                  stow
doxygen                                 libsoup                                 streamlink
dpkg                                    libspectre                              streamripper
drafter                                 libspectrum                             stress-ng
drone-cli                               libssh                                  stunnel
dscanner                                libssh2                                 stuntman
dspdfviewer                             libstatgrab                             subnetcalc
dub                                     libsvm                                  subversion
duc                                     libtensorflow                           suil
duck                                    libtins                                 suite-sparse
duo_unix                                libtrace                                sundials
dwdiff                                  libu2f-host                             supervisor
dynamips                                libuninameslist                         svgo
dynare                                  libuv                                   svtplay-dl
e2fsprogs                               libvirt                                 swagger-codegen
easy-tag                                libvirt-glib                            swagger-codegen@2
ecasound                                libvisio                                swaks
eccodes                                 libvpx                                  swi-prolog
efl                                     libwebsockets                           swift-protobuf
eiffelstudio                            libxkbcommon                            swiftformat
ejabberd                                libxlsxwriter                           swiftlint
ekg2                                    libxml++                                swig
elasticsearch                           libxml++3                               sylpheed
elektra                                 libxmlsec1                              sync_gateway
elixir                                  libzdb                                  syncthing
elm-format                              link-grammar                            synfig
embree                                  linkerd                                 sysdig
embulk                                  links                                   tag
emscripten                              liquibase                               taisei
encfs                                   liquid-dsp                              tarantool
enchant                                 lldpd                                   taskell
enigma                                  llvm                                    tbb
enscript                                llvm@7                                  tealdeer
entr                                    lmdb                                    teleconsole
envconsul                               lmod                                    telegraf
epic5                                   lnav                                    telegram-cli
eprover                                 log4cplus                               teleport
epubcheck                               log4shib                                template-glib
erlang                                  logcheck                                tepl
erlang@20                               logstash                                termtosvg
erlang@21                               logtalk                                 terraform
eslint                                  lolcat                                  terraform-inventory
esptool                                 loudmouth                               terraformer
etcd                                    lsd                                     terragrunt
ethereum                                lsof                                    terrahub
ettercap                                luarocks                                tesseract
exa                                     luvit                                   tfenv
exempi                                  lxc                                     thors-serializer
exercism                                lynis                                   tiger-vnc
exiftool                                lz4                                     tika
exim                                    mackup                                  tile38
exiv2                                   macvim                                  tintin
expat                                   mafft                                   tinyxml2
exploitdb                               magic-wormhole                          tmate
f3                                      mailutils                               tmpreaper
faas-cli                                makensis                                tmux
fabric                                  makepkg                                 tmux-xpanes
fastjar                                 mame                                    todoman
fasttext                                mariadb                                 tokei
faudio                                  mariadb-connector-c                     tomcat
fauna-shell                             mariadb@10.1                            tomcat-native
fceux                                   mariadb@10.2                            tomcat@7
fdroidserver                            maxwell                                 tomcat@8
feedgnuplot                             mbedtls                                 tomee-plus
feh                                     mcabber                                 tomee-webprofile
ffmpeg                                  mdbook                                  topgit
ffmpeg@2.8                              mdbtools                                topgrade
ffsend                                  mdds                                    tor
fio                                     mdk                                     tox
firebase-cli                            media-info                              traefik
flake8                                  mediaconch                              trafficserver
flashrom                                mednafen                                translate-shell
flawfinder                              megatools                               translate-toolkit
flex                                    memcached                               triton
flow                                    memcacheq                               ttyd
fluid-synth                             menhir                                  tunnel
fluxctl                                 mercurial                               tvnamer
fn                                      mesa                                    twemcache
folly                                   meson                                   twine-pypi
fontforge                               mesos                                   txr
fonttools                               metabase                                typescript
fossil                                  metricbeat                              u-boot-tools
fourstore                               mfterm                                  ucloud
fpp                                     mg                                      udunits
fq                                      micronaut                               ufraw
fragroute                               midgard2                                uftp
freeciv                                 midnight-commander                      uhd
freediameter                            mighttpd2                               unbound
freedink                                mikutter                                ungit
freeipmi                                mill                                    unrtf
freeradius-server                       minbif                                  unzip
freetds                                 mingw-w64                               urh
frpc                                    minio                                   uriparser
frps                                    minio-mc                                userspace-rcu
frugal                                  miniserve                               util-linux
fs-uae                                  minizinc                                utimer
fselect                                 mit-scheme                              uwsgi
fstrm                                   mkcert                                  v8
fuse-emulator                           mkl-dnn                                 vagrant-completion
fuse-zip                                mkvtoolnix                              vala
futhark                                 mlkit                                   valabind
gabedit                                 mmark                                   valgrind
gammaray                                mmseqs2                                 vamp-plugin-sdk
gammu                                   moarvm                                  vapoursynth
gauche                                  mockserver                              vapoursynth-imwri
gauge                                   modules                                 vapoursynth-ocr
gawk                                    moe                                     vapoursynth-sub
gbdfed                                  monero                                  vault
gcab                                    monetdb                                 vault-cli
gcc                                     mongoose                                vaulted
gcsfuse                                 monit                                   vegeta
gdal                                    monitoring-plugins                      velero
gdcm                                    monkeysphere                            verilator
gdk-pixbuf                              mono                                    vert.x
gdl                                     mono-libgdiplus                         vfuse
gdmap                                   mosh                                    vice
gearman                                 mosquitto                               viewvc
gearsystem                              mp3cat                                  vifm
gegl                                    mp3splt                                 vim
genometools                             mpdscribble                             vim@7.4
geoserver                               mpg123                                  vimpc
gerbil-scheme                           mpop                                    vips
gerbv                                   mrboom                                  virgil
get_iplayer                             msitools                                visp
getdns                                  msmtp                                   vit
getmail                                 mu                                      vitetris
getxbook                                mujs                                    vmtouch
ghex                                    mupdf                                   vnstat
ghostscript                             mutt                                    volatility
ghr                                     mycli                                   vowpal-wabbit
gibo                                    mypy                                    vte
ginac                                   mysql++                                 vte3
git-absorb                              mysql@5.7                               vtk
git-annex                               mysqltuner                              vttest
git-cinnabar                            n                                       vulkan-headers
git-cola                                nagios                                  wandio
git-crypt                               nagios-plugins                          watchexec
git-extras                              nano                                    watson
git-flow-avh                            nativefier                              wcslib
git-fresh                               nats-server                             wdfs
git-lfs                                 nats-streaming-server                   wdiff
git-recent                              nave                                    webdis
gitbucket                               ncdc                                    webpack
gitg                                    ncdu                                    websocat
gitlab-runner                           ncmpc                                   webtorrent-cli
gitleaks                                nco                                     wgetpaste
gitmoji                                 ncrack                                  whois
gitversion                              ncview                                  widelands
gjs                                     neo4j                                   winetricks
gkrellm                                 neomutt                                 wireguard-go
glade                                   neovim                                  wireguard-tools
glances                                 netdata                                 wiremock-standalone
glib-networking                         nethack                                 wla-dx
glibmm                                  newman                                  wmctrl
glide                                   newsboat                                wolfssl
glooctl                                 newt                                    wp-cli
gloox                                   nfdump                                  wskdeploy
glyr                                    nghttp2                                 wtf
gmic                                    nginx                                   wv
gmime                                   ngircd                                  wxmac
gmsh                                    nickle                                  wxmaxima
gmt                                     nim                                     x11vnc
gnome-autoar                            nlohmann-json                           x265
gnome-builder                           nmh                                     x3270
gnome-latex                             nnn                                     xa
gnome-recipes                           node-build                              xapian
gnome-themes-standard                   node@10                                 xboard
gnu-apl                                 node@8                                  xcodegen
gnu-getopt                              nomad                                   xdot
gnu-indent                              nopoll                                  xmake
gnu-typist                              nordugrid-arc                           xml-tooling-c
gnumeric                                noti                                    xonsh
gnunet                                  notmuch                                 xorriso
gnupg                                   nqp                                     xrootd
gnuplot                                 nrpe                                    xsane
gnuradio                                nsd                                     xsimd
go                                      nspr                                    xtensor
go@1.11                                 nss                                     xxhash
goaccess                                ntfs-3g                                 yaf
gobby                                   ntp                                     yamllint
gobuster                                nwchem                                  yank
gocryptfs                               nylon                                   yarn
godep                                   nyx                                     yash
goffice                                 nzbget                                  yaws
golang-migrate                          ocaml                                   yaz
gom                                     ocaml-findlib                           ydcv
goocanvas                               ocaml-num                               ykman
goofys                                  ocamlbuild                              ykpers
gopass                                  ocamlsdl                                yle-dl
goreleaser                              ocproxy                                 yosys
gpa                                     ocrad                                   you-get
gpac                                    ocrmypdf                                youtube-dl
gpgme                                   octave                                  zabbix
gphoto2                                 ode                                     zabbix-cli
gpredict                                odpi                                    zbackup
gpsim                                   offlineimap                             zboy
gqview                                  omega                                   zelda-roth-se
gr-osmosdr                              omniorb                                 zenity
gradio                                  oniguruma                               zeromq
gradle                                  onscripter                              zimg
grafana                                 opa                                     znc
grails                                  opam                                    zola
grakn                                   open-jtalk                              zsdx
graph-tool                              open-mesh                               zsh-autosuggestions
graphicsmagick                          open-mpi                                zshdb
graphviz                                open-zwave                              zstd
grok                                    openapi-generator                       zsxd
gromacs                                 openblas                                zurl
groonga                                 opencolorio
groovy                                  openconnect
==> Renamed Formulae
confluent-oss -> confluent-platform                          transmission -> transmission-cli
==> Deleted Formulae
cherokee       ctunnel        frag_find      ftimes         libggz         liblacewing    lysp           smlnj
csup           dsd            freetds@0.91   guile@2.0      libguess       libopkele      pincaster      varnish@4

==> Downloading https://homebrew.bintray.com/bottles/bash-5.0.9.mojave.bottle.tar.gz
==> Downloading from https://akamai.bintray.com/d9/d9329137f3f6e5a2953d4ae6ee7df3db48d336b47da39597fce086dfa7aba67c?__gd
######################################################################## 100.0%
==> Pouring bash-5.0.9.mojave.bottle.tar.gz
������  /usr/local/Cellar/bash/5.0.9: 150 files, 9.4MB

Code:
MBA_NOW:~ Tim$ bash --version
GNU bash, version 3.2.57(1)-release (x86_64-apple-darwin18)
Copyright (C) 2007 Free Software Foundation, Inc.
]MBA_NOW:~ Tim$ exit
logout
Saving session...
...copying shared history...
...saving history...truncating history files...
...completed.
Deleting expired sessions...418 completed.

[Process completed]

New terminal window:

Code:
MBA_NEW:~ Tim$ bash --version
GNU bash, version 5.0.9(1)-release (x86_64-apple-darwin18.6.0)
Copyright (C) 2019 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>

This is free software; you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
MBA_NEW:~ Tim$

These 2 Users Gave Thanks to Neo For This Post:
Login or Register for Dates, Times and to Reply

Previous Thread | Next Thread
Thread Tools Search this Thread
Search this Thread:
Advanced Search

Test Your Knowledge in Computers #253
Difficulty: Easy
The Defense Advanced Research Projects Agency (DARPA) is an agency of the United States Department of Defense originally designed by the Jefferson Airplane Company.
True or False?

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

User input and run awk using the input

I am trying to allow a user to enter in text and then store that text in a variable $gene to run in an awk command in which those values are used to run some calculations. I am getting syntax errors however, when I try. Thank you :). The awk runs great if it is a pre-defined file that is used,... (7 Replies)
Discussion started by: cmccabe
7 Replies

2. Red Hat

"rhgb quiet" controlling the display of commands in single user mode ?"rhgb quiet" controlling the d

Why does removing "rhgb quiet" from the kernel boot parameters control whether or not the commands I enter are displayed in single user mode ? For instance, if I do not remove "rhgb quiet", when I am in single user mode, whatever command I type will not be displayed on the screen. The... (0 Replies)
Discussion started by: Hijanoqu
0 Replies

3. Shell Programming and Scripting

Check user input

Hi, I need my script to check if the user enters 3 values if not 5 values to my script and alert if the input has any other number of values. for example: ./myscript.sh 22 56 3221 - > correct ./myscript.sh 22 56 3221 45 777 -> correct ./myscript.sh 22 56 3221 45 -> incorrect Please... (6 Replies)
Discussion started by: mohtashims
6 Replies

4. Shell Programming and Scripting

Script interacts with user , based on user input it operates

i have a script which takes input from user, if user gives either Y/y then it should continue, else it should quit by displaying user cancelled. #!/bin/sh echo " Enter your choice to continue y/Y OR n/N to quit " read A if then echo " user requested to continue " ##some commands... (7 Replies)
Discussion started by: only4satish
7 Replies

5. Shell Programming and Scripting

How to get the user input recursively until the user provides valid input

Hi, echo "Enter file name of input file list along with absolute path : " read inputFileList if then for string in `cat inputFileList` do echo $string done else echo " file does not exist" fi From the above code, if the user enters a invalid file... (1 Reply)
Discussion started by: i.srini89
1 Replies

6. Shell Programming and Scripting

Bash user input

Hi all, I currently have a script which uses read -p for user interaction. e.g. read -p "New user? " user Is it possible to have it so if the user enters nothing and just presses return it can resort to a specified value instead? Thanks! :) (5 Replies)
Discussion started by: JayC89
5 Replies

7. Shell Programming and Scripting

Get Hidden Input from User.

HI All, I want to take input from user on linux console...but i dont wnt it to be visible.. just like we type password for ssh or scp Right now I am using "read" to take input from user but it also makes it visible when user type it. read -ep "Dear User Please enter password : " pass... (8 Replies)
Discussion started by: mkashif
8 Replies

8. Shell Programming and Scripting

awk user input

Using the following I'm trying to print the user's response to the prompt Y / N but I get nothing other than the contents of $1? awk '{ printf($1 " ? (Y/N)") getline myresponse < "-" system("read myresponse") if (myresponse == "Y") { print $1... (17 Replies)
Discussion started by: gefa
17 Replies

9. Shell Programming and Scripting

Getting user input

I am trying to create a shell (ksh) which has two "read" commands, one which reads a line from a file and another which is inside a loop that reads user input from a keyboard. However, the "read" command inside the loop uses the input from the file and it does not get the user input from keyboard.... (3 Replies)
Discussion started by: stevefox
3 Replies

10. Shell Programming and Scripting

user input date

I am trying write a script that takes user input date in the format "Mar 18". If it is march1 it is like "Mar 1" . Once i take this input i will go back to my log files and search for any failed transactions recorded that day. If there are then i will send it to a file and mail it. I am... (10 Replies)
Discussion started by: gundu
10 Replies

Featured Tech Videos