Questions tagged [stdin]
The stdin tag has no usage guidance.
32
questions
111
votes
9
answers
164k
views
Can I send some text to the STDIN of an active process running in a screen session?
I have a long-running server process inside a screen session on my Linux server. It's a bit unstable (and sadly not my software so I can't fix that!), so I want to script a nightly restart of the ...
33
votes
4
answers
55k
views
Writing to stdin of background process
I'm on an Ubuntu 10.04 box, and started a server in the background (myserver &) over ssh. It's been running fine, but I need a way to get at the server's stdin, as the only way to control the ...
11
votes
5
answers
5k
views
Is there a way to make objdump read from STDIN instead of a file?
In my specific case, I want to use it to dump what I echo.
I don't want to involve any file...
Is there a way to make objdump read from STDIN instead?
9
votes
1
answer
15k
views
Write to stdin of a running process using pipe
I am in a similar situation as in this post
But I couln't get the solution provided there to work in my situation as the answer seems related to that question only.
In particular, I couldnt ...
9
votes
2
answers
6k
views
Write to the stdin of a running process with the same effect/behaviour of directly writing
This post answers only partial my question. My problem is that writing to the stdin of the running process using the FD of process on the /proc filesystem does not have the same effect.
Problem:
...
8
votes
4
answers
12k
views
Testing for a script that is waiting on stdin
Is there a way to determine if a script is waiting on stdin and cause the command to exit if detected?
Here's an example, the command I'm executing takes a long time to run, but it will also prompt ...
8
votes
4
answers
1k
views
Should a foreground program invoked by a daemon split logging between stderr and stdout based on severity levels?
Usually log messages are written to stderr. I'm wondering if it is a good idea/practice to split log messages so that errors and warnings go to stderr while debug/informational/notice messages go to ...
8
votes
2
answers
10k
views
How to send text to stdin of docker container?
I have a docker container which runs a java program in foreground on startup. The java program listens to input on stdin. How can I programmatically send text to the java program?
The container is ...
6
votes
6
answers
2k
views
Prevent sudo, apt-get, etc. from swallowing pasted input to STDIN?
I often write up wiki instructions to install various server packages on Ubuntu (11.10 Oneiric at the moment). They always involve things like:
sudo apt-get install -y postfix
sudo cp ~/siteconfig/...
5
votes
3
answers
4k
views
How to keep script from swallowing all of stdin?
I have a script that reads from a pipe in a loop and runs an expect script and a normal shell script in the loop. Both scripts run ssh to another server to grab a piece of data. For example:
cat /...
4
votes
1
answer
2k
views
BASH: alternatives to coproc [closed]
I have some scripts which use coproc to control stdout/stdin of subprocesses.
Unfortunately, coproc was introduced in Bash 4.0, and on many systems I use, there is an earlier versions of bash.
Are ...
2
votes
3
answers
5k
views
Suppress GPG "Reading passphrase from file descriptor 0" message
Simply, how can I make GPG not print that message? Here are the commands I'm using:
echo "test input" > test.in
echo "test" | gpg -q -c --passphrase-fd 0 --output test.enc --yes --force-mdc test....
2
votes
2
answers
20k
views
nc exits immediately, on connection, when run as an upstart job
I'm using the following /etc/init/jsonlog.conf upstart job:
description "jsonlog"
start on runlevel [23]
stop on runlevel [06]
respawn
script
cd /tmp
echo "about to listen"
/bin/nc -l ...
2
votes
1
answer
759
views
CentOS 5.3, Perl, bash commands, Hide ALL output to screen
I am running the following command:
[user@server ~]$ /usr/sbin/ntpdate -d IPREMOVEDFORSECURITY | egrep 'transmit timestamp' | tail -1 | awk '{print $4, $5, $6, $7, $8}'
host found : ...
2
votes
2
answers
1k
views
Unix wrapper to make any binary accept stdin/stdout redirection
This is a common situation: you want to include command 'foo' as part of a pipeline, but unfortunately command 'foo' only accepts actual filenames for I/O and does not read/write from stdin/stdout. I ...
2
votes
1
answer
3k
views
How can I use scp without providing a password
I have asked a question before in here. My question was that I tried to give my password to scp via piping
echo mypassword | scp [email protected]:project/* ~/project/
However it still asks me ...
2
votes
2
answers
893
views
Bash Parallelization of CPU-intensive processes
tee forwards its stdin to every single file specified, while pee does the same, but for pipes. These programs send every single line of their stdin to each and every file/pipe specified.
However, I ...
2
votes
1
answer
497
views
Write to the stdin of a running process (without changing the way of starting the program) [closed]
In this post there is described how to start a program and then to send data to the stdin of the program (with FIFOs). But what to do if the program is already running, and I cannot re/start the ...
1
vote
2
answers
4k
views
Passing scripts to ssh and invoking the shebang
I have scripts in several languages which I pipe to ssh to have them invoked on other hosts. For shell scripts I'm able to do this:
ssh < /path/to/script.sh
For scripts in other languages however,...
1
vote
1
answer
207
views
How to feed the variable with end of lines to standard input of other application in bash?
Is there a (simple) way to feed variable with end of lines to other program in BASH? Consider example:
flist=$(ls -l)
echo $flist
echo will replace all end of lines with spaces, so my output will be ...
1
vote
1
answer
2k
views
Cannot login to ssh - stdin: is not a tty
FIXED
If you have seen this in the login screen of your server...
stdin: is not a tty
...you know the trouble. Well. I've had the exact same problem on my root server. I tried several things to ...
1
vote
1
answer
745
views
Sendmail bash script invoked by cron can't read from stdin
I try to write a little script that overwrites from adress of nullmailer. Nullmailer has an option "allmailfrom" you can put a mail adress into /etc/nullmailer/allmailfrom and all mails sent have this ...
0
votes
1
answer
2k
views
Background job terminates when run from script, but works fine when run from bash prompt
I'm on MacOS 10.9.4. I want to put sftp to background to automatically push some files to it through named pipe later, as suggested here. It works fine when I enter commands manually from bash prompt (...
0
votes
1
answer
568
views
Linux does STDOUT | STDIN piping write data to disk?
I was planning on passing encryption keys to zfs load-key pool/set through stdin. The keys passed are generated by another program in HEX format and dataset is configured to have keylocation=prompt, ...
0
votes
2
answers
5k
views
Run a multiline bash script piped from stdin
I'm looking for a simple way to include multi-line scripts inline in documentation to make it transparent what each step does.
This works
echo "echo 1234" | bash
So does this
echo 'for N in 1 2 3; ...
0
votes
2
answers
2k
views
how to save stderr and stdout to a file in ubuntu
when i run
echo "invalid crt" | openssl x509 -noout -modulus | openssl md5 &>> error.log
this show below error
unable to load certificate
139903857870496:error:0906D06C:PEM routines:...
0
votes
2
answers
2k
views
Sudo seemingly not obeying -S parameter
I am running some scripts as part of pre/post deploy using DeployHQ, I need to be able to call the script on one line and for there to be no feedback from the terminal so I want to pass the password ...
0
votes
1
answer
4k
views
reading stdin in shell
#!/bin/sh
#myVar=`date`#case 1
#myVar=`cat /dev/stdin`#case 2
myVar=($(< /dev/stdin)) #case 3
echo $myVar
exit 2
case 1 works
case 2 and 3 don't work.
When I test with either 2 or 3; there is no ...
0
votes
2
answers
860
views
"Bad File Descriptor" error using Python/CGI in IIS 6.1
Background:
I've attempted (strong emphasis on "attempt") to set up an application via IIS (6.1, Windows Server 2008 R1) that routes all requests through a python script. The end goal was to create ...
0
votes
0
answers
517
views
Docker closes STDIN despite "--interactive"
I'm trying to detach and reattach to a Docker container started with docker run in foreground mode. The issue I'm seeing is that during the initial detach Docker closes STDIN unexpectedly.
Here's an ...
0
votes
2
answers
892
views
Gitosis-init returns "Fatal Python error: <stdin> is a directory", why is this?
I'm trying to get gitosis installed because I want to use Indefero and I need a deamon for the git:// protocol. However, following the instructions in the Git Pro book (http://progit.org/book/ch4-7....
0
votes
3
answers
1k
views
An SQLite/STDIN Conundrum, Specific to AIX
I'm been playing around with SQlite at work, specifically with trying to get the sqlite3 command line tool to accept stdin instead of a file. Sounds easy enough, on linux you can execute a command ...