if the command is with a pipe, how to deal with permission problem with sudo
the following command
sudo -u liy echo "update moz_cookies set value='f1=40000000&f3=40000&fv=11.2.202' where name='PREF' and host='.youtube.com';"|sqlite3 /user/liy/home/.mozilla/firefox/dd1pkryp.default/cookies.sqlite
leads to problem:
cannot open directory /user/liy/home/.mozilla/firefox/: Permission denied
how to deal with this? thanks
Put the
sudoon the command doing the modifying:You might even consider using a heredoc: