Created
August 20, 2017 14:06
-
-
Save classmember/e4b0ac2599da19b7bdc2ab13d64461dd to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# controlling a screen session from the terminal | |
screen_name="fab_session_${RANDOM}" # Generate unique screen session name | |
screen -S ${screen_name} -d -m # Open detached screen session | |
# Send commands to the screen session | |
screen -S ${screen_name} -p 0 -X stuff "echo \'hello world\!\'^M" | |
screen -S ${screen_name} -p 0 -X stuff "echo -n \'Still here, \!\'^M" | |
screen -S ${screen_name} -p 0 -X stuff "echo -n \' Still selling real fake doors\!\'^M" | |
# Output from: | |
# $ screen -r ${screen_name} | |
# | |
# ~ 09:59:59 kolby | |
# 1 ❯ echo 'hello world\!' | |
# hello world\! | |
# ~ 10:02:06 kolby | |
# ❯ echo -n 'Still here, \!' | |
# Still here, \! ~ 10:03:08 kolby | |
# ❯ echo -n ' Still selling real fake doors\!' | |
# Still selling real fake doors\! ~ 10:03:29 kolby |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment