Re: [uml-user] Problem in configuring the networking settings using shell script

2005-01-21 Thread Blaisorblade
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

Re: [uml-user] Problem in configuring the networking settings using shell script

2005-01-20 Thread D. Bahi
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

[uml-user] Problem in configuring the networking settings using shell script

2005-01-20 Thread Jimmy Pan
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.