10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Well.. let's say i need to write a pretty simple script.
In my script i have 2 variables which can have value of 0 or 1.
$VERBOSE
$LOG
I need to implement these cases:
($VERBOSE = 0 && $LOG = 0) => ONLY ERROR output (STDERR to console && STDOUT to /dev/null)
($VERBOSE = 1... (5 Replies)
Discussion started by: Marmz
5 Replies
2. Shell Programming and Scripting
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
3. Shell Programming and Scripting
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
4. UNIX for Dummies Questions & Answers
When a process fork(), the child share the same file descriptors as his father. Thus, they share the same stdin. Quick and dirty exemple below (sorry for the ugly gets() call) :
#include <stdio.h>
#include <unistd.h>
int main()
{
char buf;
if (fork()) { /*parent */
... (1 Reply)
Discussion started by: milouz
1 Replies
5. UNIX for Dummies Questions & Answers
Hi,
Program A: uses pipe()
I am able to read the stdout of PROGAM B (stdout got through system() command) into PROGRAM A using:
* child
-> dup2(fd, STDOUT_FILENO);
-> execl("/path/PROGRAM B", "PROGRAM B", NULL);
* parent
-> char line;
-> read(fd, line, 100);
Question:
---------... (3 Replies)
Discussion started by: vvaidyan
3 Replies
6. Programming
Hi,
Program A: uses pipe()
I am able to read the stdout of PROGAM B (stdout got through system() command) into PROGRAM A using:
* child
-> dup2(fd, STDOUT_FILENO);
-> execl("/path/PROGRAM B", "PROGRAM B", NULL);
* parent
-> char line;
-> read(fd, line, 100);
Question:
---------... (1 Reply)
Discussion started by: vvaidyan
1 Replies
7. Shell Programming and Scripting
can you redirect STDIN with command arguments?
I have tried this approach:
# ./script -option <argument1> <argument2> 0<$2
# $2: ambiguous redirect
Is this possible? (4 Replies)
Discussion started by: prkfriryce
4 Replies
8. Shell Programming and Scripting
hello all,
I need to create a password change utility for a database. I need to gather at the command line the username, password and database sid. I have the program currently doing this. What I would like to do is not have the new password appear on the screen when I do my read command.... (2 Replies)
Discussion started by: whited05
2 Replies
9. HP-UX
How can I access the standard-in device in HP-UX? I am trying to automate sftp on an HP-UX system. On solaris I can just do:
sftp -b /dev/fd/0 remotehost <<EOF
cd pub
ascii
get filename.txt
bye
EOF (2 Replies)
Discussion started by: dangral
2 Replies
10. Programming
hi,
how does a program know whether some data are available from stdin?
I would like to make a program which could read its data from stdin
and _if_there_is_nothing_at_stdin_ from a file which name is given
as an argument. If there is nothing in stdin and no filename is given as
argument,... (2 Replies)
Discussion started by: marquis
2 Replies