LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 02-26-2006, 10:02 PM   #1
lsgko
Member
 
Registered: Aug 2003
Location: USA
Distribution: Fedora Core 4
Posts: 48

Rep: Reputation: 15
Question Automating tasks by redirecting input


I've got some scripts which require input. I'd like to automate the scripts by providing input when I execute them.

I've try something like "/home/user/script < input" but that doesn't seem to work. How would I go about doing this?

Thanks in Advance.
 
Old 02-26-2006, 10:20 PM   #2
nguyennh
Member
 
Registered: Feb 2006
Location: Vietnam
Distribution: FC , RH , SuSE
Posts: 106

Rep: Reputation: 15
Using $# and $@ as your number of argument and argument list => You have to enter your arg list when running your scripts .

If your want your input is a file , you have to write file-processing (open, read) code in your scripts .
 
Old 02-26-2006, 10:29 PM   #3
lsgko
Member
 
Registered: Aug 2003
Location: USA
Distribution: Fedora Core 4
Posts: 48

Original Poster
Rep: Reputation: 15
The thing is that I didn't write the scripts I'm trying to automate so I'm hoping there is a solution without modifying the scripts (and possibly breaking them).
 
Old 02-26-2006, 11:44 PM   #4
Tinkster
Moderator
 
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 914Reputation: 914Reputation: 914Reputation: 914Reputation: 914Reputation: 914Reputation: 914Reputation: 914
Have a look at expect


Cheers,
Tink
 
Old 02-26-2006, 11:47 PM   #5
nguyennh
Member
 
Registered: Feb 2006
Location: Vietnam
Distribution: FC , RH , SuSE
Posts: 106

Rep: Reputation: 15
Wink

Quote:
Originally Posted by lsgko
I've try something like "/home/user/script < input" but that doesn't seem to work.
I think you must know the input format .
Can you provide me your script in details , especially which lines show it gets argument ?
 
  


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
Bash Shellscript automating command input JoeneB Programming 3 01-13-2006 01:59 AM
Ctrl+Shift Unicode input gone, after installing Japanese Input Methodes polemon Linux - Newbie 1 09-20-2005 05:17 PM
Sendmail: timeout waiting for input from local during Draining Input andrewstr Linux - Software 0 07-14-2004 01:43 PM
my mouse input is takes as keyboard input in BASH e1000 Slackware 5 12-08-2003 03:00 PM
automating simple tasks blistfix Linux - Newbie 1 08-20-2001 06:29 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 08:59 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
Open Source Consulting | Domain Registration