10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
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
2. Shell Programming and Scripting
Good morning!
How do I make the info that someone inputs from @userArray = <STDIN>, a new array?
@userArray = <STDIN>;
while ()
{
chomp;
last if ! /\d/;
push(@userArray,$_);
}
my($sum,$avg) = &sumIt(@userArray);
print "Total:$sum\nAverage:$avg\n";
Im... (2 Replies)
Discussion started by: bigben1220
2 Replies
3. UNIX for Dummies Questions & Answers
Hello,
my C application under unix runs in redirecting stdin to a file.
Example:$appli1 <file1. This application waits often on a scanf().
But I would temporarely reassign stdin at the keyboard for waiting a user's answer. So I thought to add system("appli2"); in the code of appli1. In its... (4 Replies)
Discussion started by: cypleen
4 Replies
4. 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
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
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
8. Shell Programming and Scripting
Hi all,
Consider the following situation:
- you launch an compiled binary application from inside a unix shell which presents a text-based type user interface where you can input information ...
# echo "I am the $SHELL shell"
# I am the /bin/bash shell
# ./input
# ... imagine the binary... (3 Replies)
Discussion started by: domivv
3 Replies
9. 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
10. Shell Programming and Scripting
Why doesnt echo output the contents of the file abc.txt as shown below ?
chid@athena:~$ cat abc.txt
sssss
chid@athena:~$ echo < abc.txt
chid@athena:~$ (6 Replies)
Discussion started by: systemsb
6 Replies