You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

50 lines
1.6 KiB

  1. From 23712cea8e2a623fd952eb781df0011c501703d0 Mon Sep 17 00:00:00 2001
  2. From: Thorsten Glaser <tg@mirbsd.org>
  3. Date: Thu, 25 Jul 2013 22:07:33 +0200
  4. Subject: [PATCH] Make default mkshrc file suitable for OpenWrt environment:
  5. * Part of the FreeWRT patches:
  6. - no hostname(1)
  7. - ls(1) has no -o option
  8. * OpenWrt and FreeWRT-1.0 fix:
  9. - since this is not ~/.mkshrc make sure subshells find it
  10. ---
  11. dot.mkshrc | 10 +++++++---
  12. 1 file changed, 7 insertions(+), 3 deletions(-)
  13. diff --git a/dot.mkshrc b/dot.mkshrc
  14. index 233a10c..caf482c 100644
  15. --- a/dot.mkshrc
  16. +++ b/dot.mkshrc
  17. @@ -28,8 +28,8 @@ case $KSH_VERSION in
  18. *) return 0 ;;
  19. esac
  20. -PS1='#'; (( USER_ID )) && PS1='$'; [[ ${HOSTNAME:=$(ulimit -c 0; hostname -s \
  21. - 2>/dev/null)} = *([ ]|localhost) ]] && HOSTNAME=$(ulimit -c 0; hostname \
  22. +PS1='#'; (( USER_ID )) && PS1='$'; [[ ${HOSTNAME:=$(</proc/sys/kernel/hostname
  23. + )} = *([ ]|localhost) ]] && HOSTNAME=$(ulimit -c 0; hostname \
  24. 2>/dev/null); : ${EDITOR:=/bin/ed} ${HOSTNAME:=nil} ${TERM:=vt100}
  25. : ${MKSH:=$(whence -p mksh)}; PS4='[$EPOCHREALTIME] '; PS1=$'\001\r''${|
  26. local e=$?
  27. @@ -50,7 +50,7 @@ unalias ls
  28. alias l='ls -F'
  29. alias la='l -a'
  30. alias ll='l -l'
  31. -alias lo='l -alo'
  32. +alias lo='l -al'
  33. alias doch='sudo mksh -c "$(fc -ln -1)"'
  34. whence -p rot13 >/dev/null || alias rot13='tr \
  35. abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ \
  36. @@ -402,4 +402,8 @@ alias cls='print -n \\033c'
  37. unset p
  38. +# we need this in OpenWrt for subshells that are not login shells
  39. +: ${ENV=/etc/mkshrc}
  40. +[[ -z $ENV ]] || export ENV
  41. +
  42. : place customisations above this line
  43. --
  44. 2.1.1