LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   shell script interaction (https://www.linuxquestions.org/questions/linux-software-2/shell-script-interaction-263530/)

sudhasmyle 12-07-2004 03:01 AM

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.:tisk:

leontini 12-08-2004 03:34 PM

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


All times are GMT -5. The time now is 04:05 PM.