Find the answer to your Linux question:
Results 1 to 4 of 4
Hi, I need help with a bash script. I'm writing one that will run only in a screen session. and sometimes it'll output some garbage that i'd like to see ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Jun 2011
    Posts
    9

    How can I turn off screen logging from a bash script ?


    Hi,

    I need help with a bash script. I'm writing one that will run only in a screen session. and sometimes it'll output some garbage that i'd like to see when looking at the screen session, but it's totally unneccessary to put it in the session logs. I'm using the built in screen logging. Now I know I can disable/reenable it by c-a H keys, but I need to do that from the script so it can disable the logging before displaying the garbage, and reenable it after it's displayed.

    Thank you in advance for any help.

    Best regards
    Szafran

  2. #2
    Trusted Penguin
    Join Date
    May 2011
    Posts
    4,353
    Hi,

    I believe you can send keystrokes to the screen terminal using screen's "stuff" command. I'm not sure if you can send keybinds (e.g. c-a H), but maybe...check it out in the screen man page.

  3. #3
    Just Joined!
    Join Date
    Jun 2011
    Posts
    9
    Thanks for the info, I belive I've tried that allready.
    But anyways. This is what is spits out:

    Code:
    szafran@NAS:~$ stuff
    stuff: command not found
    So I think that stuff command can only be used in the rc file, and I need something that I can use from bash script.

  4. $spacer_open
    $spacer_close
  5. #4
    Trusted Penguin
    Join Date
    May 2011
    Posts
    4,353
    Quote Originally Posted by szafran View Post
    So I think that stuff command can only be used in the rc file, and I need something that I can use from bash script.
    No, it's part of screen, treat it like an argument to screen, e.g.:

    Code:
    screen -S myprog -X stuff "my code"
    Last edited by atreyu; 10-28-2012 at 12:48 AM. Reason: typo

Posting Permissions

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