On Friday 21 January 2005 04:03, D. Bahi wrote:
> i'm no shell god but this seems suspect:
> your sourcing from and redirecting to the same file.
Yes, I can confirm this does not work (because I risked losing datas for this)
- when doing, for instance:
sed a > a
the shell first opens (and clear
i'm no shell god but this seems suspect:
your sourcing from and redirecting to the same file.
> cat $net_file | sed "s/address 192.168.1.*/address 192.168.1.$1/" >
$net_file
> cat $net_file | sed "s/gateway 192.168.1.*/gateway 192.168.1.$gw/" >
$net_file
try redirecting to a tmpfile instead and
the following is the content of the shell script, /bin/setip written by me.
#!/bin/bash
PATH="$PATH:/bin:/sbin";
export PATH;
let gw=255-$1
net_file=/etc/network/interfaces
host_file=/etc/hostname
# change ip address and gateway of the UML
cat $net_file | sed "s/address 192.168.1.*/address 192.168.