Advertisement
Guest User

busybox to (function | alias) generator

a guest
Jul 27th, 2017
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.45 KB | None | 0 0
  1. # Access busybox commands when there is no writeable disk.
  2. #
  3. # NB: you probably only want one _or_ the other of these.
  4. #
  5. # First create bash-style functions, second aliases.
  6.  
  7.  
  8. busy2function () {
  9. busybox --list | printf( "alias %s=" "\x22" "busybox %s" "\x22" ";\n", $1, $1 )}'
  10. }
  11.  
  12. eval $(busy2alias)
  13.  
  14. busy2function () {
  15. busybox --list |
  16. busybox awk '{printf( "function %s () { busybox %s $*; };\n", $1, $1 )}'
  17. }
  18.  
  19. eval $(busy2function)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement