If I login to a remote machine, establish a screen session with screen -s name
, switch to another user account, and login to a Rails 2 console, is there a way to grab the screen session name in Ruby, for logging purposes?
Asked
Active
Viewed 128 times
1

Vadim Kotov
- 8,084
- 8
- 48
- 62

almagest
- 13
- 4
-
1Are you okay with doing it at the system level (i.e., shelling out from irb)? IOW, do you have a way of getting the screen session name from a system command? – likethesky Oct 01 '12 at 23:12
1 Answers
0
If you can obtain the screen session name from the underlying OS, then in Ruby you can always execute a command by using backticks or the system
call. See "Getting output of system() calls in ruby" for more details.
EDIT:
BTW, be sure to see this particular answer.

Community
- 1
- 1

likethesky
- 846
- 3
- 12
- 28