Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

shell script problem 1

Status
Not open for further replies.

QatQat

IS-IT--Management
Nov 16, 2001
1,031
IT
Hi there,

I am running this script succesfully on FEDORA CORE 2 to update enom DNS address


----------------------------------------------------
#!/bin/bash

#assign adsl address to a variable $DYNIP_ADDR
export DYNIP_ADDR=$(ifconfig ppp0 | grep -i "addr:" | cut -f2 -d: | cut -f1 -d " ")
#pass the values to enom DNS register through the querystring
curl "


#print out the new IP address
echo $DYNIP_ADDR;


-----------------------------------------------------

When I try to run it on my RedHat 9 machine in the office it replies

:bad interptreter: no such file or directorysh


Anyone knows what could be the problem?

Thanks a lot.

Qatqat

Life is what happens when you are making other plans.
 
The cause could be a couple of things including having bad line breaks in the script file due to it being edited under windows, or not having an appropriate call to an interpreter on the first line (ie #!/bin/bash). If it's the former, try converting your file using something like dos2unix (does this exist in Linux?). In the second case check that /bin/bash exists and if it doesn't, install it. HTH.
 
thanks a lot.


It was edited in windoz and it f***ed it up.

Cheers

Qatqat

Life is what happens when you are making other plans.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top