shell script read line from file, use it in command
i need a script to read the first line from a text file which contains the ip address of my box, and use it in the command
#ez-ipupdate -a ip.ip.ip.ip
where ip.ip.ip.ip is the ip read from the file.txt
i think should read the lint to a var, and use it in the command ?
can someone write a whole script ?
cuz i'm new to shell scripts
thnx
i tryed.. i did something like this
#!/bin/bash
echo Updating dynamic host
wget -N whatismyip.com/automation/n09230945.asp
autoip='head -n 1 n09230945.asp'
echo $autoip
-
its not done yet , but i already have error
./autoip: command not found
though bash exists in path !!
user@ubuntu7:~$ whereis bash
bash: /bin/bash /etc/bash.bashrc /usr/share/man/man1/bash.1.gz
Last edited by DiGiGoth; 08-31-2008 at 09:32 AM.
|