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 12-07-2004, 03:01 AM   #1
sudhasmyle
Member
 
Registered: Nov 2004
Distribution: RedHat
Posts: 37

Rep: Reputation: 15
shell script interaction


Hi everyone,
I want to configure the PPPoE protocal. There are the command adsl-setup,adsl-connect,adsl-start & adsl-stop are there. My question is when i activate the adsl-setup
command it ask the username and interface and etc....
Is it possible to write a shell script to activate the 'adsl-setup' and give the information about what time it ask such as usrname and interface and DNS details from the "file". That file is i already edited and store the details in,
root
eth0
203.14.56.78
203.45.56.12 etc...,

Is there any shell command is there for interacting the shell script at run time.
 
Old 12-08-2004, 03:34 PM   #2
leontini
Member
 
Registered: Aug 2003
Location: Melbourne, Australia
Distribution: Fedora Core 8-10
Posts: 61

Rep: Reputation: 15
sudhasmyle,

I'm not sure what you need to pass to your script, but you have a couple of options.

The first is to pass variable values in when you invoke your script, just like you do with commands like cp, rm, etc.
Eg myscript var1 var2 ...
The value of var1 will be held in a variable called $1, var2 in $2 ... (I'm sure you see the pattern arising)

The second is to get the script to call for them and input them as required, eg
>Please enter the value of var1:

"the_value"

You achieve this by scripting

set var1 = $</

This sets the value of var1 to "the_value".

I got this from checking up in "Linux programmers reference", and the particular syntax is for the tcsh shell, but the others are all pretty similar.

Good luck
 
  


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 script inside shell script treotan Linux - General 4 02-19-2009 06:34 AM
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
Interaction in shell script sudhasmyle Programming 1 12-08-2004 07:27 AM
[SHELL SCRIPT] Write at the right of the shell window Creak Linux - General 2 04-02-2004 03:00 PM

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

All times are GMT -5. The time now is 06:48 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