Skip to content

Instantly share code, notes, and snippets.

@ivey
Created June 6, 2010 03:25
Show Gist options
  • Save ivey/427262 to your computer and use it in GitHub Desktop.
Save ivey/427262 to your computer and use it in GitHub Desktop.
edit () {
new_args=()
LIMIT=$#
for ((i = 1; i <= $LIMIT; i++ )) do
eval file="\$$i"
if [[ -e $file && ! -O $file ]]
then
new_args[i]="/sudo::$file"
else
new_args[i]=$file
fi
done
command $EMACS_CLIENT -n $new_args
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment