Problem in making a script

Nils Kassube kassube at gmx.net
Sat Jul 2 15:12:24 UTC 2011


Amrit Pal Pathak wrote:
> On Sat, Jul 2, 2011 at 7:21 AM, Nils Kassube <kassube at gmx.net> wrote:
> > > sudo wget http://202.164.53.116/~amritpal/edit/kannel.conf
> > > sudo chmod a+w kannel.conf
> > 
> > While these lines have nothing to do with your original question,
> > I'll comment on them anyway. These lines are a bit strange because
> > first you use sudo to wget a file, and then you change the
> > permissions to make the file world writeable. If you don't use
> > sudo for the wget command, you don't need to change the
> > permissions afterwards.
> 
>       I think you said reverse.Your meaning might "if you use sudo
> for wget a file ,there is no need to change the permissions".

No, if you use "sudo wget ...", the file is owned by root and writeable 
only by root. Therefore you used "sudo chmod ..." to make it writeable 
by the user. However if you use wget without sudo in the first place, 
the file is already owned and writeable by the user and no chmod is 
needed. Therefore I would suggest to replace the two commands above with 
this single command:

wget http://202.164.53.116/~amritpal/edit/kannel.conf


Nils




More information about the ubuntu-users mailing list