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

    How to turn a non-interactive shell into an interactive shell?

    I have a situation where I am in a non-interactive shell. Therefore I do not see the output of anything I type unless I do like so:

    ls -al > /dev/tty1

    I have tried from within my non-interative shell to spawn an interactive shell like so:

    /bin/sh -i

    but my output still does not goto me. Isn't there a way I can somehow go into /proc or somwhere and make the output my /dev/tty1? Or some way else to remedy this?

    The situation arises because I drop from my restricted shell environment (a sort of CLI interface), into the actual Linux shell. I cannot change the code of the CLI environment I am just faced with being in the linux shell environment and its non-interactive. Its very annoying to have to put > /dev/tty1 after every command I type.

    Not to mention it seems damn near impossible to get pagers like more and less to work properly when your in a non-interactive shell.

    Thanks in advance for any ideas

  2. #2
    You can redirect the shell output to a file when you launch it, as in,

    uname@ubuntu:~$ bash > file.txt
    Which is equivalent to putting > file.txt after every command you type.

  3. #3
    Just what I was looking for, thanks!

  4. $spacer_open

Posting Permissions

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