PINE64

Full Version: Can't find "sudo gedit" alternative
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
How can I edit a admin text file with Phosh?  Cant seem to find how to edit a file as root.
In Phosh, you can go to Settings > Applications to view a list of installed applications. I'm running Mobian and gedit is listed as "Text Editor". You can open the app in software manager for more detail, like its actual name.
I can't execute the command in Phosh for some reason!  Nothing opens.

Response from Alpine Linux Chat:
"<user1> Please don't launch GUI apps with root
<user1> Doesn't work on any Wayland environment
<user1> You could make a simple bash script that copies the file to $(mktemp -d)/file, opens that with gedit and sudo cp the temp file
<user2> EDITOR=gedit sudoedit?
<user1> Right, that does basically that, right?"
Indeed, please don't escalate the privileges of text editors. Use one of these (identical) commands instead:

Code:
sudo -e || sudoedit

If you're using Bash, try this:

Code:
printf '%b' "export EDITOR=gedit\nexport VISUAL=gedit\n" | tee -a ~/.profile
. ~/.profile && echo $EDITOR $VISUAL
sudo -e /path/to/file