Sponsored Content
Top Forums Shell Programming and Scripting [stdin / stdout] Strategies for redirecting outputs Post 302995648 by Don Cragun on Monday 10th of April 2017 02:25:39 AM
Old 04-10-2017
Is this a homework assignment? Homework and coursework questions can only be posted in the Homework & Coursework forum under special homework rules.

If you did post homework in the main forums, please review the guidelines for posting homework and repost.

If you did not post homework, please explain the company you work for and the nature of the problem you are working on. And, tell us what operating system you're using, tell us what shell you're using, and tell us how redirecting STDIN (i.e. Standard Input) has anything to do with controlling where normal and diagnostic output should be written?
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Redirecting to stdin

Hi, I'm having trouble with my script. I have to select different choices without any interaction from a menu that looks like : a - xxxxxxxxxxxxxx b - xxxxxxxxxxxxxx c - xxxxxxxxxxxxxx d - xxxxxxxxxxxxxx I tried things like : echo "a" >&0 read < echo "a" but none worked. Any... (4 Replies)
Discussion started by: flame_eagle
4 Replies

2. Programming

stdout/stdin + flushing buffers

Hi all I've run into a snag in a program of mine where part of what I entered in at the start of run-time, instead of the current value within printf() is being printed out. After failing with fflush() and setbuf(), I tried the following approach void BufferFlusher() { int in=0;... (9 Replies)
Discussion started by: JamesGoh
9 Replies

3. UNIX for Dummies Questions & Answers

Redirecting several outputs to /dev/stdout

I have an executable that, depending on its input, outputs to either one file or several. It usually prints nothing on screen. The usual way to call this program is to specify an input and output filenames, like this: ./executable.exe -i inputfile -o outputfileIt will then try to use the output... (1 Reply)
Discussion started by: aplaydoc
1 Replies

4. Shell Programming and Scripting

Redirecting stdin from fd 3-9?

Hi I'm trying to do something on the bash command line that I will later put into a bash shell script. I'm trying to take a program that reads stdin (using getline) and be able to keep it running in the background and fire "commands" to it. So what I thought I should do was to try taking... (3 Replies)
Discussion started by: niceguyeddie
3 Replies

5. UNIX for Dummies Questions & Answers

Redirect stdin stdout to multiple files

Hi, i know how to a) redirect stdout and stderr to one file, b) and write to two files concurrently with same output using tee command Now, i want to do both the above together. I have a script and it should write both stdout and stderr in one file and also write the same content to... (8 Replies)
Discussion started by: ysrini
8 Replies

6. Shell Programming and Scripting

can't close stdin/stdout in shell

#!/bin/sh exec 0</dev/null exec 1>/dev/null ls -l /proc/self/fd >&2 produces total 0 lr-x------ 1 tyler users 64 Feb 18 10:38 0 -> /proc/7886/fd lrwx------ 1 tyler users 64 Feb 18 10:38 1 -> /dev/pts/4 lrwx------ 1 tyler users 64 Feb 18 10:38 2 -> /dev/pts/4 I've verified the shell is... (10 Replies)
Discussion started by: Corona688
10 Replies

7. Shell Programming and Scripting

Redirecting stdin/stdout to/from command from/to string

Hi, I am working on a project where I have to generate and execute nasm code on-the-fly. I generate the code in a file program.asm and then execute it.This output is to stdout which i redirect to an output file which i read back to compare results: system("nasm -f elf program.asm >... (5 Replies)
Discussion started by: doc_cypher
5 Replies

8. Programming

read and write stdin/stdout in unix

Hi, i am using the below program to read from the standard input or to write to standard out put. i know that using highlevel functions this can be done better than what i have done here. i just want to know is there any other method by which i find the exact number of characters ( this... (3 Replies)
Discussion started by: MrUser
3 Replies

9. UNIX for Dummies Questions & Answers

multiple variables assignement (stdout/stderr outputs)

Hi all, I've been looking around for this for a while and can't seem to find a satifactory way to do what I want: I would like to assign the output of stdout to a variable and that of stderr to another one, and this without using temporary files/named pipes. In other words be able to assign... (4 Replies)
Discussion started by: anthalamus
4 Replies

10. UNIX for Dummies Questions & Answers

STDIN and STDOUT

Hallo, i have a script like: if ;then echo "OK" else echo "ERROR $2 is missing" fi; if ;then touch $2 fi; if ;then cat $1 | grep xy > $2 (1 Reply)
Discussion started by: eightball
1 Replies
PROCMETER3-LOG(1)					      General Commands Manual						 PROCMETER3-LOG(1)

NAME
procmeter3-log - A system monitoring / logging program. SYNOPSIS
procmeter3-log [-h|--help] [--rc=<filename>] [--...] [...] DESCRIPTION
ProcMeter Displays one or more pieces of information about the operating system and other resources. Most of the information that is dis- played comes from the /proc filesystem. The program is modular and very configurable. OPTIONS
The command line options are described below. -h Provides a help message listing the available outputs. This will be different for different computers depending on the Linux kernel version that is being used and the hardware/software that is configured. --rc=<filename> Load the specified .procmeterrc file in stead of the searching in the usual places. --... A list of configuration file options that will override the values in the .procmeterrc file. The format of these options is (for example) --library.path=/usr/local/procmeter3 which is equivalent to the entry in the .procmeterrc file of [library] path = /usr/local/procmeter3 All spaces around the equal sign must be removed and if spaces are required in the value on the right hand side then quotes must be used around the entire command line option. ... A list of names of outputs that are to be displayed. This can include any of the outputs that are available (see the -h option). For the CPU usage is in a module named Statistics with an output named CPU and there are graph (-g), text (-t) and bar (-b) options. Since this version of the program does not display anything, but logs the data to a file it does not matter which one is chosen. To store the CPU usage data you would use the command line option Statistics.CPU-t USAGE
When started the program will log all of the requested information on the standard output (stdout). The outputs that are displayed are those from the command line and those from the .procmeterrc configuration file. MODULES
The modules that are available for procmeter3-log are described in the procmeter3_modules(1) manual page. SEE ALSO
procmeterrc(5) procmeter3_modules(1) AUTHOR
Andrew M. Bishop 1998-2007 July 3, 2010 PROCMETER3-LOG(1)
All times are GMT -4. The time now is 09:19 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy