No such file or directory - init-script - "sed" command
Added by Ninety almost 16 years ago
Hi everyone,
I'm installing Lighttpd (1.4.23) from source following this tutorial InstallFromSource. Configure, make, make install went without problem but when I use the sed
command for the init-script part I get an error:
ninety@ninety-laptop:~/Desktop/lighttpd-1.4.23$ sed -e 's/FOO/lighttpd/g' doc/rc.lighttpd > /etc/init.d/lighttpd bash: /etc/init.d/lighttpd: Permission denied
Adding sudo
before sed
doesn't change anything, however if I try this I get something else:
ninety@ninety-laptop:~/Desktop/lighttpd-1.4.23$ sed -e 's/FOO/lighttpd/g' doc/rc.lighttpd > sudo /etc/init.d/lighttpd sed: can't read /etc/init.d/lighttpd: No such file or directory
So, do I have to create an empty file in /etc/init.d/
or can I copy rc.lighttpd
in /etc/init.d/
and then try something like this:
sudo sed -e 's/FOO/lighttpd/g' sudo /etc/init.d/lighttpd
Thanks!
OS: Ubuntu 9.04, 64-bit version
Replies (2)
RE: No such file or directory - init-script - "sed" command - Added by penma almost 16 years ago
The first happens because you cannot write to /etc/init.d as user.
The second doesn't do what you expect it to do. The result is that bash misparses the line like: sed -e '...' doc/rc.lighttpd /etc/init.d/lighttpd > sudo
Either go to a root shell and do all the stuff as said in the tutorial or run "sudo cp doc/rc.lighttpd /etc/init.d/lighttpd" and edit it with "sudo sed -e '..." /etc/init.d/lighttpd".
Stuff doesn't magically fix itself by writing sudo everywhere. Read a manual.
RE: RE: No such file or directory - init-script - "sed" command - Added by tapas_mishra over 14 years ago
You very nicely gave a funda.
Did you ever yourself tried what you are suggesting.
And to the reply of original poster you said to read the manual what help did the person got from your reply.
Can you give an exact link to above problem.
First try before you even post such arbit things.