My build of nnn with minor changes
25'ten fazla konu seçemezsiniz Konular bir harf veya rakamla başlamalı, kısa çizgiler ('-') içerebilir ve en fazla 35 karakter uzunluğunda olabilir.
 
 
 
 
 
 

22 satır
408 B

  1. #!/usr/bin/env sh
  2. # Description: Edit file as superuser
  3. #
  4. # Shell: POSIX compliant
  5. # Author: Anna Arad
  6. EDITOR="${EDITOR:-vim}"
  7. is_cmd_exists () {
  8. which "$1" > /dev/null 2>&1
  9. echo $?
  10. }
  11. if [ "$(is_cmd_exists sudoedit)" -eq "0" ]; then
  12. sudoedit "$1"
  13. elif [ "$(is_cmd_exists sudo)" -eq "0" ]; then
  14. sudo "$EDITOR" "$1"
  15. elif [ "$(is_cmd_exists doas)" -eq "0" ]; then
  16. doas "$EDITOR" "$1"
  17. fi