Advertisement
Guest User

Untitled

a guest
Jul 28th, 2016
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.63 KB | None | 0 0
  1. #!/bin/bash
  2. cd /home/pi/JPGS
  3. fn=$(ls -rt1 | tail -1)
  4. mv -f $fn /home/pi/WWW/webpic.jpg
  5.  
  6. #! /bin/sh -
  7. cd /home/pi/JPGS || exit
  8. fn=$(ls -t | head -n1)
  9. mv -f -- "$fn" /home/pi/WWW/webpic.jpg
  10.  
  11. #! /bin/zsh -
  12. mv -f /home/pi/JPGS/*.jpg(.om[1]) /home/pi/WWW/webpic.jpg
  13.  
  14. fn=(/home/pi/JPGS/*.jpg(.om[1]))
  15.  
  16. $ ls -t | head -n1
  17.  
  18. -t sort by modification time, newest first
  19.  
  20. -c with -lt: sort by, and show, ctime (time of last modification of
  21. file status information) with -l: show ctime and sort by name
  22. otherwise: sort by ctime, newest first
  23.  
  24. $ ls -tc | head -n1
  25.  
  26. $ mv -f -- "$fn" /home/pi/WWW/webpic.jpg
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement