Advertisement
Guest User

Untitled

a guest
Mar 4th, 2015
183
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.55 KB | None | 0 0
  1. #!/bin/bash
  2. cd ~/Desktop;
  3. thefile= ls -t -U | grep -m 1 "Screen Shot";
  4. echo "Most recent screenshot is: "$thefile;
  5.  
  6. Screen Shot 2011-07-03 at 1.55.43 PM.png
  7. Most recent screenshot is:
  8.  
  9. thefile=$(ls -t -U | grep -m 1 "Screen Shot")
  10.  
  11. thefile=$(ls -t *"Screen Shot"* | head -n 1)
  12.  
  13. echo "Most recent screenshot is: $thefile"
  14.  
  15. thefile=$(find -maxdepth 1 -type f -name "*Screen Shot*" -printf "%T@ %p" |
  16. sort -k 1n | tail -n 1)
  17.  
  18. #!/bin/zsh
  19. set -e
  20. cd ~/Desktop
  21. thefile=(*"Screen Shot"*(om[1]))
  22. echo "Most recent screenshot is: $thefile"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement