Questions tagged [stdin]

32 questions
2
votes
1 answer

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 : HOSTREMOVEDFORSECURITY Tue, Feb 15 2011 12:38:38.321 So the issue…
Garrett
  • 23
  • 2
2
votes
2 answers

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 was looking for a way to "load balance" the stdin…
ehsanul
  • 427
  • 1
  • 8
  • 19
2
votes
1 answer

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 tim@xxx.xxx.xxx.xxx:project/* ~/project/ However it still asks me to manually input the password. How should I…
Tim
  • 1,487
  • 6
  • 28
  • 43
1
vote
1 answer

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 address as "Return-Path", but From is still the…
Hannes
  • 307
  • 2
  • 12
1
vote
1 answer

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 remount /dev/pts or /dev/tty but nothing worked and I…
Leon Kasko
  • 21
  • 4
1
vote
1 answer

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 different from the content of the variable. Other…
Alex Gitelman
  • 275
  • 2
  • 7
1
vote
2 answers

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, I find myself having to do this: ssh python - <…
Matt Joiner
  • 191
  • 1
  • 8
0
votes
2 answers

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:PEM_read_bio:no start line:pem_lib.c:703:Expecting: TRUSTED…
Surjit Sidhu
  • 173
  • 1
  • 1
  • 6
0
votes
1 answer

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 (using cat as listener job for simplicity): $…
0
votes
2 answers

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 into the sudo command (instead of sudo asking for…
Toby
  • 630
  • 2
  • 7
  • 17
0
votes
1 answer

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 output and the script never exits What I eventually…
Stewie
  • 577
  • 2
  • 7
  • 17
0
votes
2 answers

"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 a very light-weight API on the server. Basically,…
zashu
  • 143
  • 6
0
votes
2 answers

Gitosis-init returns "Fatal Python error: 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.html) I run into trouble pretty soon. This is what…
Jasper Kennis
  • 379
  • 1
  • 3
  • 12
0
votes
3 answers

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 like: echo 'test' | sqlite3 test.db '.import…
mikfreedman
0
votes
0 answers

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 example script: /tmp/echo.sh #!/bin/bash while…
Zpin
  • 1