gnu-screen

bash cron flock screen

孤街浪徒 提交于 2019-12-17 16:59:47
问题 I am using cron to run a bash script periodically, and trying to use flock to prevent this script and the processes it creates from being run multiple times. The entry in crontab to run it every minute is: */1 * * * * flock -n /tmp/mylockfile /home/user/myscript.sh arg1 arg2 The problem is, myscript.sh spawns multiple screen sessions in detached mode, it contains for i in {1..3}; do screen -d -m ./mysubscript.sh arg3 done Running screen with "-d -m" as above starts screen in "detached" mode

Binding M-<up> / M-<down> in Emacs 23.1.1

天涯浪子 提交于 2019-12-17 05:02:14
问题 I'm trying to put in a feature that I miss from Eclipse, where Alt +[ Up / Down ] transposes the lines up or down, but can not for the life of me figure out how to assign to these keys properly. I am using it in -nw mode (so just in a shell window), and typically run in a screen session. Using a global key binding, I can get it to work with letter combinations, like (kbd "M-m") , but every combination I have tried for the arrow keys just gives me a message that doesn't make sense, I always

Vim: map GNU Screen command

 ̄綄美尐妖づ 提交于 2019-12-13 20:00:24
问题 Apologies if this has been asked before, but I feel overwhelmed with the Vim docs and I can't seem to figure this out. I want to map the F5 key in Vim to accomplish the following actions: Yank text from the visual selection in Vim. Execute the yanked portion of the text in another GNU Screen session named ipython . The second portion could be achieved by issuing the following command line argument (via :! ), if only I was able to find a way to paste the register content between the double

Unable to bind HJKL to DLTH in Screen's C-A Esc -mode

五迷三道 提交于 2019-12-12 19:36:14
问题 I want my Zsh to be Dvorak friendly in Screen. I am trying to make the following bindings in Zsh such that I can use them in Ctl-a Esc mode in moving h => d j => l k => t l => n I have not yet found any ways to do that. How can you make the following keybindings in Screen , such that I can use them in the mode C-A Esc? 回答1: Screen has a markkeys configuration option that lets you remap the keys used in scrollback mode. The following code makes Screen Dvorak friendly in .screenrc markkeys h=d

How to check screen is running?

无人久伴 提交于 2019-12-12 19:27:48
问题 How to check in Python whether the screen with the given name. For example, check if server1 is running? Thanks : ) 回答1: The built in command for finding current screen sessions is screen -ls To get the same functionality in python: from subprocess import check_output def screen_present(name): var = check_output(["screen -ls; true"],shell=True) if "."+name+"\t(" in var: print name+" is running" else: print name+" is not running" screen_present("server1") A couple of comments on the code: I

How can I stop VI from overlapping and hiding the last page of command line output?

狂风中的少年 提交于 2019-12-12 12:16:23
问题 Currently, when I start vi in a terminal window within screen, the vi program takes up the full screen and covers up any of the output history that was there, and then remains there upon exiting. Thus, when scrolling back through my terminal output at a later time, the output under the vi window is masked. I'm currently working around this with the following alias in my bashrc... alias vi='for i in $( seq 1 $LINES ); do echo ; done ; vi' This has worked just fine so far, but it strikes me as

Starting up a screen (unix command) + running a command in 1 command?

与世无争的帅哥 提交于 2019-12-12 08:36:41
问题 Was wondering how I can start up a command such as: while :; do ./myCommand; done; But instead of doing the usual screen -S nameOfMyScreen Then the command while :; do ./myCommand; done; Then detach the screen ^a ^d (Control "a" the control "d" I would like it to start and detach. Thanks! 回答1: screen -d -m sh -c "while :; do ./myCommand; done;" Explanation: -d -m starts screen in detached mode (create session but don't attach to it) sh -c commandline starts a shell which executes the given

How to use a bash script to run multiple non-ending commands on Linux using Tmux

半世苍凉 提交于 2019-12-12 04:24:02
问题 I had a .txt script that was running fine, opening several screen windows and running several commands. Then, I added a new line, saved it, ran the script and it no longer works. I decided to put it back to how it was, but it still does not work, and the code is exactly the same as before. I have heard that screen is very buggy and no longer supported, so I guess it is because of that. This is the code: screen -t ur10_server 0 stuff "cd ~/catkin_ws; source devel/setup.bash; " stuff "roslaunch

cygwin screen session problems through php

爷,独闯天下 提交于 2019-12-12 03:21:39
问题 Windows, cygwin. I've successfully created a screen session and used it how i would like from a command prompt: screen -S remote then can stuff it like so: screen -S remote -X stuff blah and everthing works just peachy. However, I am trying to do the stuffing from a PHP script. <?php exec("screen -S remote -X stuff blah"); ?> to no avail. It seems that PHP can only use screen with certain options. <?php exec("screen -ls"); ?> works as expected, listing the current screen sessions, but i

How to start a process from another application and then open a terminal to that process in gnu screen

无人久伴 提交于 2019-12-11 19:16:43
问题 I'd like to be able to launch a process from a GUI application (right now I'm thinking specifically of letting an eclipse user -- possibly via a plugin -- click a button to launch a build using my organization's build system). I don't want this process to stop when I stop the parent application, and I want to be able to "switch into it" later, as though I launched it from a command line. I've seen GNU screen described as good for most of what I'm asking for, but I'm not sure about the "launch