io redirection is the process of changing where the output and input of a program originate

learn more… | top users | synonyms (1)

1
vote
2answers
47 views

Log the output of Expect command

I have made the below expect script and I need to log the output of that script. SOURCE_FILE=`ls -l *.txt --time-style=+%D | grep ${DT} | grep -v '^d' | awk '{print $NF}' ` if [ -n "${SOURCE_FILE}" ] ...
1
vote
2answers
150 views

CSH and all output (with errors) to file

I need save all output from compilation to file. I have many errors "undefined reference" and I want see all of these errors. I try "makeall >& out", but in file "out" aren't any of error "...
0
votes
2answers
63 views

Suppress warning messages from MySQL in shell script but allow errors

My log files are getting dumped with following message while running shell scripts using some underlying MySQL commands. Here is the message: "Warning: Using a password on the command line ...
0
votes
2answers
32 views

operate on different sections of stdin without intermediate file

Is there a simple way to do this with redirection or pipes without creating FILE1? I want to apply process2 to the body of the output of process1, without touching the first and last few lines. ...
0
votes
2answers
2k views

How to redirect output of a 'xterm -hold -e' command

I know you can use tee to log output from a command in a terminal, e.g.: df -h | tee ~/log.txt However, how can I do this with a more complex command like this: xterm -hold -e program arg1 arg2 ...
0
votes
2answers
303 views

Unix how to loop through directories, send output to another directory with base name of input file

I am an infrequent user of UNIX, I'm sure this will be fairly trivial for any regular user so I appologize for that. I have the following code: for file in /home/sub1/samples/aaa*/*_novoalign.bam ...
4
votes
1answer
852 views

KSH styling text based menu using STDERR

Is it possible to format the STDERR in order to have a better looking menu using the select command? I have a simple select select oChoice in $(<tempMenu.menu) ; do case "$oChoice" in ...
2
votes
1answer
229 views

Capturing data from a Fluke 1620a via Bash /dev/tcp file descriptor

I am currently trying to develop a script that will connect to a Fluke DewK 1620a Themo-Hygrometer and pull the current temperature and humidity readings from the device. While these devices have a ...
1
vote
1answer
28 views

How can I capture screen output to a named file on a command by command bases?

I am running commands remotely stuffing them into screen commands via SSH. Rather than type directly into the terminal displayed, I use remote SSH commands which are run by clicking a button in a GUI. ...
0
votes
1answer
37 views

Redirect keyboard input to unfocused program

I'm looking for some help with a computing issue. I'm running Openbox 3.5.2 on Raspbian/Pi3 and a single monitor. I want to have one program focused and in fullscreen while the keyboard outputs to ...
0
votes
1answer
71 views

Redirect output of: yum repolist all

If you run the command: yum repolist all you will see there are basically four columns of data. repo id, repo name, status, install count. If however your run something like: yum repolist all > ...
0
votes
1answer
20 views

GDB - Call second program

I have a program which I want to debug gdb. And I want to call a second program to redirect the output to the first program. How this is done in gdb. I tried it like that: run -2 < $(python ...
0
votes
1answer
63 views

Starting job via SSH and detaching from a composite command

I'd like to start a long running script via SSH and immediately return. Afterwards, I want to check the remote host every 5 minutes to see if the job is done. In order to accomplish the first part, I ...
0
votes
1answer
89 views

Cron to find exec cp and redirect output with time / date per line?

I try to setup a cron task to run a set of basic shell commands. I need to look to any files created on the last day, then copy to another folder and generate a log stating, line by line, the date ...
0
votes
1answer
46 views

Is it ever possible for command redirection to HDD to fail?

I'm using Xubuntu 15.04, and sometimes have this really strange problem, originating from a XeLaTeX run. When using this typesetting system, the following system command is executed: uname -s > &...
0
votes
1answer
72 views

need to get the command information over ssh and the input from file

I am writing a script to get the command information of the remote machine usinf while and for loop. PFB the script. But the script ends by giving the single command information only. I have multiple ...
0
votes
1answer
413 views

Redirect a directory as input to a script and output to a file

I want to use a directory name as a parameter for a pre-made script. Then the output goes into a newly made file in the home directory. It involves pipe/redirection. How do I do that? read dir $dir &...
0
votes
1answer
146 views

Prompting when redirecting content of script to remote machine

I have simple script: #!/bin/bash while getopts ":u:" opt; do case $opt in u) USER="${OPTARG}" ;; \?) echo "Unknown flag has been used: -$OPTARG" >&2 exit 1 ...
5
votes
0answers
51 views

Piping the output of a bash script after redirecting stderr

because of the way my hoster does things I have to use a system for services. This service has a run file which it executes and pipes into a second run file. But I use a (given) python package that ...
2
votes
0answers
33 views

Trap ctrl c not working as expected

I have a code that looks like this: { trap cleanup SIGHUP SIGINT SIGTERM function executed() { if [ ${1} -ne 0 ] then echo "Failed!" cleanup ...
1
vote
0answers
18 views

How to limit/monitor a cgroup process's blkio when process has output redirection

I have some questions on cgroup blkio controller. I want to limit the IOPS on a specific process. This process uses IO redirection to write the stdout contents into a file. I tried to put the ...
1
vote
0answers
313 views

Recording shell output for interactive commands

While looking into a shell redirection problem, I found a couple of answers that pointed me to the script command. As I understand it, script just records in- and output of the terminal, and allows me ...
1
vote
0answers
258 views

extract text to csv file from output of reading multiple files into specific rows

I am trying to write a bash script to generate a csv file from text within multiple pdf documents. I have a script for converting pdf to text, but not for generating the csv file. Each text document ...
1
vote
0answers
242 views

Captive portal detection, popup implementation?

Based on hostapd, I m building a captive portal. - My Linux Machine provides a Wifi access. - iPad's and Android clients-tablets connect this Wifi. Generally, any client OS check if a url is ...
1
vote
0answers
60 views

Inherit IO redirections from a script to another

When I redirect the output of a script within a script, I expect the redirection to be applied to the called script as well as the program called within it. A: ./B 2>> error.log B: ./...
1
vote
0answers
420 views

Why the output is not written to log from expect script

I am trying to write the output of the netcat command including the command also to a file by logging into remote servers. But it is not writing. What am I missing ? #!/usr/bin/expect -f set user [...
0
votes
0answers
24 views

Bash Script to start a service on Ubuntu Linux 16.04

Does the following Ubuntu 16.04 bash script command: exec /usr/lib/mono/4.5/mono-service.exe \ /home/frank/Debug/My_Camera_Recorder.exe "$@" >& /dev/null start the My_Camera_Recorder ...
0
votes
0answers
36 views

run command line contains redirection >> inside Guest VM

Another alternative of running ls -l /home for example in Guest VM called myvm ,is to run on the host the following command : vboxmanage --nologo guestcontrol myvm --username root --password xxxx ...
0
votes
0answers
109 views

Stop stdout log being clipped (by heroku-local)

I run heroku local with the Procfile: web: start-nginx gunicorn -c gunicorn.conf.py app:app start-nginx does some environment setup, and then ends with: { nginx --some-params & $@ ; } the ...
0
votes
0answers
101 views

How to enter username and password automatically in jrerun command?

jrerun is a command belongs to IBM Process Manager tool. This command will re-run the failed job. I want to create a script that re-runs automatically if it fails before 1 hour from start time. The ...
0
votes
0answers
46 views

writefile() to file descriptor produces output with alignment issue

The command that produces weird output: $ vim -ec 'call writefile(["line1","line2"],"/proc/self/fd/9") | qall!' 9>&1 1>/dev/null 2>&1 line1 line2 $ Same command ...
0
votes
0answers
77 views

How to rewrite the comand using I/O redirections?

Is there any way to rewrite the following command using only I/O redirections and not pipes ? ls -l | grep User | wc -l | tail -l
0
votes
0answers
270 views

how to route traffic on port to ip:port on linux?

I'm trying to route all traffic on port udp 5000 to udp 192.168.0.1:12333 with the following command: $ iptables -t nat -A PREROUTING -p udp -m udp --dport 5000 \ -j DNAT --to 192.168.0.1:12333 ...
0
votes
0answers
110 views

Why is a here-string command substitution considered as a single line?

I'm experimenting with while read syntax and there is a thing I don't understand. The most basic scenario which reproduces the problem is the following: a bash script a.sh calls another script b.sh ...