2 ms·
I have often wished there were something equivalent for nano. (Of course you can just save to another file and sudo mv it into place.) In the spirit of this tr
by rgovostes 5y ago
I have often wished there were something equivalent for nano. (Of course you can just save to another file and sudo mv it into place.)
In the spirit of this trick, you could set the SPELL environment variable to a script that does
#!/bin/sh
read -p "Path: " FILENAME
cat "$1" | sudo tee "$FILENAME"
and then invoke it with ^T. (Bonus points: Extract the destination filename automatically from `ps -p $PPID -o command=` (somewhat portable) or /proc (Linux).)