Skip to content

Instantly share code, notes, and snippets.

@vbarbarosh
Created May 20, 2019 17:49
Show Gist options
  • Save vbarbarosh/673d5a3dd200aae1b8dfa7603adf9288 to your computer and use it in GitHub Desktop.
Save vbarbarosh/673d5a3dd200aae1b8dfa7603adf9288 to your computer and use it in GitHub Desktop.
shell_bash_jobs_fg – Using fg command https://codescreens.com
#!/bin/bash
# http://www.gnu.org/software/bash/manual/bash.html#The-Set-Builtin
# http://redsymbol.net/articles/unofficial-bash-strict-mode/
set -o nounset -o errexit -o pipefail
# Using fg command
# https://www.gnu.org/software/bash/manual/html_node/Job-Control-Basics.html
# Enable job control. Otherwise, `fg` will yield "fg: no job control"
set -m
docker run --rm adminer &
# Some other commands...
# Pressing Ctrl-C is enough to termiate docker process
# https://docs.docker.com/config/containers/multi-service_container/
fg %1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment