Advertisement
Guest User

Untitled

a guest
Jun 25th, 2017
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.39 KB | None | 0 0
  1. #!/bin/sh
  2.  
  3. # BusyBox's 'cat' can't do '-n'
  4. ##cat -n "${HOME}"/.ash_history
  5.  
  6. history_file=`ls -t -d "${HOME}"/.*_history 2>/dev/null | head -1`
  7. if [ ! -z "${history_file}" ]; then
  8. ## sed "=" "${history_file}" | sed 'N;s/\n/\t/'
  9. sed "=" "${history_file}" | sed 'N; s/^/ /; s/ *\(.\{6,\}\)\n/\1 /'
  10. else
  11. printf "%s: error: shell history file cannot be found\n" `basename "${0}"`
  12. fi
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement