LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 11-27-2003, 11:16 AM   #1
gladeiator
LQ Newbie
 
Registered: Oct 2003
Posts: 5

Rep: Reputation: 0
I/O redirection in a shell script


I want to send Data to a small program (it's Xdialog --gauge). This Xdialog waits for STDIN.
something like
# echo "20\n" | Xdialog --gauge
works but isn't really good for a process that should be continued.
Is it somehow possible to send Data to STDIN?
How do i do that?
 
Old 11-27-2003, 01:35 PM   #2
Hko
Senior Member
 
Registered: Aug 2002
Location: Groningen, The Netherlands
Distribution: ubuntu
Posts: 2,530

Rep: Reputation: 110Reputation: 110
Code:
#!/bin/bash

PIPE="/tmp/pipe_$$"
set -m

mkfifo "$PIPE"
Xdialog --ignore-eof --gauge Aloha 10 30 <"$PIPE" &

for i in `seq 0 20 100` ; do
    echo $i >"$PIPE"
    echo "$i%"
    sleep 1
done

jobs -x kill %%
rm "$PIPE"

Last edited by Hko; 11-27-2003 at 01:55 PM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Shell Redirection Delay pymehta Linux - Software 10 07-22-2009 07:31 PM
Shell Scripting: Getting a pid and killing it via a shell script topcat Programming 15 10-28-2007 02:14 AM
shell script problem, want to use shell script auto update IP~! singying304 Programming 4 11-29-2005 05:32 PM
Website redirection script PdotROSS Linux - Networking 1 09-09-2005 12:39 PM
shell script output redirection goral.j Programming 3 01-27-2005 05:34 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 01:16 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration