Switch to tty1 with Ctrl+Alt+F1 and login.
Edit the file with
sudo nano /etc/default/saned
Ctrl+O for save and Ctrl+X to leave the editor.
Or use the short command below …
Ok, @heemayl we have a sed
version, therefore we need a perl version also =)
sudo perl -i -pe 's/(^RUN=)no/$1yes/' /etc/default/saned
Example
The starting situation
% cat /etc/default/saned
# Defaults for the saned initscript, from sane-utils
# Set to yes to start saned
RUN=no
# Set to the user saned should run as
RUN_AS_USER=saned
aboettger-VirtualBox% perl -pe 's/(^RUN=)no/$1yes/' /etc/default/saned
# Defaults for the saned initscript, from sane-utils
# Set to yes to start saned
RUN=no
# Set to the user saned should run as
RUN_AS_USER=saned
The dry run
% sudo perl -pe 's/(^RUN=)no/$1yes/' /etc/default/saned
# Defaults for the saned initscript, from sane-utils
# Set to yes to start saned
RUN=yes
# Set to the user saned should run as
RUN_AS_USER=saned
aboettger-VirtualBox% perl -pe 's/(^RUN=)no/$1yes/' /etc/default/saned
# Defaults for the saned initscript, from sane-utils
# Set to yes to start saned
RUN=yes
# Set to the user saned should run as
RUN_AS_USER=saned
The replacement
% sudo perl -i -pe 's/(^RUN=)no/$1yes/' /etc/default/saned
The final situation
% cat /etc/default/saned
# Defaults for the saned initscript, from sane-utils
# Set to yes to start saned
RUN=yes
# Set to the user saned should run as
RUN_AS_USER=saned
aboettger-VirtualBox% perl -pe 's/(^RUN=)no/$1yes/' /etc/default/saned
# Defaults for the saned initscript, from sane-utils
# Set to yes to start saned
RUN=yes
# Set to the user saned should run as
RUN_AS_USER=saned
sed
version, therefore we need aperl
version also =) – A.B. Jul 15 '15 at 07:11perl -i -pe 's/no/yes/ if /^RUN=no$/' /etc/default/saned
should do it :) – Mark K Cowan Jul 15 '15 at 13:45