New answers tagged

12 votes
Accepted

job control doesn't work when I try to set up getty over serial

It's not the commands but the environment in which they run that is the difference. Normally getty is spawned directly from the system service manager (init) – both with systemd where it is a .service,...
u1686_grawity's user avatar
0 votes

Determine if process was launched directly from a terminal window or programmatically as a child process

When you source the script running with . or source before, the command ps will NOT list the sourced script name. So, one way is to do a grep to check if the sourced script name is in the ps output, ...
Sergio Abreu's user avatar
0 votes

How to configure two monitors, one for GUI, the other for console

Yes, it's possible to configure your Linux machine to display the GUI on one monitor and a text-mode console on another.  Here's a breakdown of the methods and considerations: Methods: Multiseat ...
Zenith's user avatar
  • 1
2 votes
Accepted

Script that reads input from terminal. How to tell the script to print to both tty and stdout in case it is called with a stdout redirection?

Note that if it's the prompt string you're concerned about, it should usually go to stderr. That's what most utilities do when they issue a prompt. See for instance the read 'var?prompt or ksh/zsh/...
Stéphane Chazelas's user avatar
0 votes

how to get file descriptors of PTY inside of a child?

oke, ill try to answer myself. one have to find a real tty device with isatty function feeding 0,1,2 standard descriptors. when the real/true tty is found, the ttyname function will give the path to ...
Michael Quad's user avatar

Top 50 recent answers are included