Find the answer to your Linux question:
Results 1 to 2 of 2
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1

    Running 'bash' question

    I would like to start a console window which invokes bash and have bash execute a bash command ( 'source' ) and then remain open for further user input ( be interactive ). I imagine this must be possible. How would I do this ?

    I know I can add the command to ~/.bashrc but I do not want to have the command execute each time I run a script, but only during a particular console session.

  2. #2
    i would use screen for this, e.g.:

    screen -dm
    that will launch a screen session and run your script in it. when the script is done running, you will still have the bash prompt running in the screen session.

    After you've launched the screen session, run this to show running screens:
    screen -ls
    you'll see something like:
    There is a screen on:
    1 Socket in /var/run/screen/S-user.
    There is one screen running, pid 17656. To attach to it, run:
    screen -r 17656
    To detach from a running terminal, use the key sequence Ctrl+A then D.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts