Re: [newbie] scripting problems
Somebody else can correct me if I'm wrong, but I think the command you need to make the variable permanent is 'export' as in : 'export IPADDR' - Theo Jo wrote: the thing is, I had tried that. I have a fair luggage of DOS knowledge and the variable was always empty. So I went out today and bought a book about programming: Linux programmer's reference. The mistake I made was to run my program and then ask for the contents of the variable. If I write the echo command into the script everything is fine. I guess I need some other command to make the changes permanent or at least last after my script terminated. Many thanks, Jo Patrick Putteman wrote: try : echo $IPADDR and verify if the address is what you expect it to be Patrick Putteman Internet Support Manager Net 7 www.net7.be - Original Message - From: Jo [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Saturday, August 07, 1999 10:16 AM Subject: Re: [newbie] scripting problems OK, PATH=$PATH:. worked. I set a variable in that script: IPADDR=`/sbin/ifconfig eth1 | grep "inet addr:" | cut -f2 -d: | cut -f1 -d" "` How can I check if this variable got assigned the proper value? Many tanks for your help, Jo Bernhard Rosenkraenzer wrote: On Sat, 7 Aug 1999, Jo wrote: [root@host jd]# ls -al rc_fi -rwxrwxr-x 1 root root30090 Aug 7 02:47 rc_fi [root@host jd]# rc_fi bash: rc_fi: command not found The current directory is by default not in the PATH. Either do ./rc_fi, or do export PATH=$PATH:. before running rc_fi. LLaP bero -- Tired of waiting for Windows 2000? STOP WAITING! http://www.ms-windows-2000.com/
Re: [newbie] scripting problems
OK, PATH=$PATH:. worked. I set a variable in that script: IPADDR=`/sbin/ifconfig eth1 | grep "inet addr:" | cut -f2 -d: | cut -f1 -d" "` How can I check if this variable got assigned the proper value? Many tanks for your help, Jo Bernhard Rosenkraenzer wrote: On Sat, 7 Aug 1999, Jo wrote: [root@host jd]# ls -al rc_fi -rwxrwxr-x 1 root root30090 Aug 7 02:47 rc_fi [root@host jd]# rc_fi bash: rc_fi: command not found The current directory is by default not in the PATH. Either do ./rc_fi, or do export PATH=$PATH:. before running rc_fi. LLaP bero -- Tired of waiting for Windows 2000? STOP WAITING! http://www.ms-windows-2000.com/
Re: [newbie] scripting problems
try : echo $IPADDR and verify if the address is what you expect it to be Patrick Putteman Internet Support Manager Net 7 www.net7.be - Original Message - From: Jo [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Saturday, August 07, 1999 10:16 AM Subject: Re: [newbie] scripting problems OK, PATH=$PATH:. worked. I set a variable in that script: IPADDR=`/sbin/ifconfig eth1 | grep "inet addr:" | cut -f2 -d: | cut -f1 -d" "` How can I check if this variable got assigned the proper value? Many tanks for your help, Jo Bernhard Rosenkraenzer wrote: On Sat, 7 Aug 1999, Jo wrote: [root@host jd]# ls -al rc_fi -rwxrwxr-x 1 root root30090 Aug 7 02:47 rc_fi [root@host jd]# rc_fi bash: rc_fi: command not found The current directory is by default not in the PATH. Either do ./rc_fi, or do export PATH=$PATH:. before running rc_fi. LLaP bero -- Tired of waiting for Windows 2000? STOP WAITING! http://www.ms-windows-2000.com/
Re: [newbie] scripting problems
the thing is, I had tried that. I have a fair luggage of DOS knowledge and the variable was always empty. So I went out today and bought a book about programming: Linux programmer's reference. The mistake I made was to run my program and then ask for the contents of the variable. If I write the echo command into the script everything is fine. I guess I need some other command to make the changes permanent or at least last after my script terminated. Many thanks, Jo Patrick Putteman wrote: try : echo $IPADDR and verify if the address is what you expect it to be Patrick Putteman Internet Support Manager Net 7 www.net7.be - Original Message - From: Jo [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Saturday, August 07, 1999 10:16 AM Subject: Re: [newbie] scripting problems OK, PATH=$PATH:. worked. I set a variable in that script: IPADDR=`/sbin/ifconfig eth1 | grep "inet addr:" | cut -f2 -d: | cut -f1 -d" "` How can I check if this variable got assigned the proper value? Many tanks for your help, Jo Bernhard Rosenkraenzer wrote: On Sat, 7 Aug 1999, Jo wrote: [root@host jd]# ls -al rc_fi -rwxrwxr-x 1 root root30090 Aug 7 02:47 rc_fi [root@host jd]# rc_fi bash: rc_fi: command not found The current directory is by default not in the PATH. Either do ./rc_fi, or do export PATH=$PATH:. before running rc_fi. LLaP bero -- Tired of waiting for Windows 2000? STOP WAITING! http://www.ms-windows-2000.com/
Re: [newbie] scripting problems
Jo wrote: the thing is, I had tried that. I have a fair luggage of DOS knowledge and the variable was always empty. So I went out today and bought a book about programming: Linux programmer's reference. The mistake I made was to run my program and then ask for the contents of the variable. If I write the echo command into the script everything is fine. I guess I need some other command to make the changes permanent or at least last after my script terminated. If you're trying to get the value of the variable OUTSIDE of the script, put export in front of the variable name when you set it's value in the script... That will turn it into an environment-wide variable. So, export IPADDR=... should work and allow you to retrieve the value later. Patrick Putteman wrote: try : echo $IPADDR and verify if the address is what you expect it to be Patrick Putteman Internet Support Manager Net 7 www.net7.be - Original Message - From: Jo [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Saturday, August 07, 1999 10:16 AM Subject: Re: [newbie] scripting problems OK, PATH=$PATH:. worked. I set a variable in that script: IPADDR=`/sbin/ifconfig eth1 | grep "inet addr:" | cut -f2 -d: | cut -f1 -d" "` How can I check if this variable got assigned the proper value? Many tanks for your help, Jo Bernhard Rosenkraenzer wrote: On Sat, 7 Aug 1999, Jo wrote: [root@host jd]# ls -al rc_fi -rwxrwxr-x 1 root root30090 Aug 7 02:47 rc_fi [root@host jd]# rc_fi bash: rc_fi: command not found The current directory is by default not in the PATH. Either do ./rc_fi, or do export PATH=$PATH:. before running rc_fi. LLaP bero -- Tired of waiting for Windows 2000? STOP WAITING! http://www.ms-windows-2000.com/
Re: [newbie] scripting problems
Great! That is just what I needed. Thanks, Jo Steve Philp wrote: Jo wrote: the thing is, I had tried that. I have a fair luggage of DOS knowledge and the variable was always empty. So I went out today and bought a book about programming: Linux programmer's reference. The mistake I made was to run my program and then ask for the contents of the variable. If I write the echo command into the script everything is fine. I guess I need some other command to make the changes permanent or at least last after my script terminated. If you're trying to get the value of the variable OUTSIDE of the script, put export in front of the variable name when you set it's value in the script... That will turn it into an environment-wide variable. So, export IPADDR=... should work and allow you to retrieve the value later. Patrick Putteman wrote: try : echo $IPADDR and verify if the address is what you expect it to be Patrick Putteman Internet Support Manager Net 7 www.net7.be - Original Message - From: Jo [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Saturday, August 07, 1999 10:16 AM Subject: Re: [newbie] scripting problems OK, PATH=$PATH:. worked. I set a variable in that script: IPADDR=`/sbin/ifconfig eth1 | grep "inet addr:" | cut -f2 -d: | cut -f1 -d" "` How can I check if this variable got assigned the proper value? Many tanks for your help, Jo Bernhard Rosenkraenzer wrote: On Sat, 7 Aug 1999, Jo wrote: [root@host jd]# ls -al rc_fi -rwxrwxr-x 1 root root30090 Aug 7 02:47 rc_fi [root@host jd]# rc_fi bash: rc_fi: command not found The current directory is by default not in the PATH. Either do ./rc_fi, or do export PATH=$PATH:. before running rc_fi. LLaP bero -- Tired of waiting for Windows 2000? STOP WAITING! http://www.ms-windows-2000.com/
[newbie] scripting problems
Hi, Can somebody tell me why this doesn't work? [root@host jd]# pwd /home/jd [root@host jd]# ls -al rc_fi -rwxrwxr-x 1 root root30090 Aug 7 02:47 rc_fi [root@host jd]# rc_fi bash: rc_fi: command not found [root@host jd]# /home/jd/rc_fi bash: /home/jd/rc_fi: No such file or directory I hope it is enough information. If not please tell me what more you need to know. Thanks, Jo
Re: [newbie] scripting problems
On Sat, 7 Aug 1999, Jo wrote: [root@host jd]# ls -al rc_fi -rwxrwxr-x 1 root root30090 Aug 7 02:47 rc_fi [root@host jd]# rc_fi bash: rc_fi: command not found The current directory is by default not in the PATH. Either do ./rc_fi, or do export PATH=$PATH:. before running rc_fi. LLaP bero -- Tired of waiting for Windows 2000? STOP WAITING! http://www.ms-windows-2000.com/