Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 00802_Bla_Aquarium_00020.jpg <= this one
- 00802_Bla_Aquarium_00021.jpg
- 00802_Bla_Aquarium_00022.jpg
- 00802_Bla_Aquarium_00023.jpg
- 00802_Bla_Aquarium_00024.jpg <= this one
- 00802_Bla_Aquarium_00025.jpg
- 00802_Bla_Aquarium_00026.jpg
- 00802_Bla_Aquarium_00027.jpg
- 00802_Bla_Aquarium_00028.jpg <= this one
- 00802_Bla_Aquarium_00029.jpg
- n=0; cp 00802_Bla_Aquarium_?????.jpg(^e:'((n++%4))':) /some/place
- # put the file list in the positional parameters ($1, $2...).
- # the files are sorted in alphanumeric order by the shell globbing
- set -- 00802_Bla_Aquarium_?????.jpg
- n=0
- # loop through the files, increasing a counter at each iteration.
- for i do
- # every 4th iteration, append the current file to the end of the list
- [ "$(($n % 4))" -eq 0 ] && set -- "$@" "$i"
- # and pop the current file from the head of the list
- shift
- n=$(($n + 1))
- done
- # now "$@" contains the files that have been appended.
- cp -- "$@" /some/place
- cp $(printf '%sn' 00802_Bla_Aquarium_?????.jpg | awk 'NR%4 == 1') /some/place
- cp 00802_Bla_Aquarium_*{00..99..4}.jpg selected
- n=0
- for file in ./*.jpg; do
- test $n -eq 0 && cp "$file" selected/
- n=$((n+1))
- n=$((n%4))
- done
- find . -maxdepth 1 -name "*.jpg" | sort | while IFS= read -r file; do
- cp "$file" selected/
- IFS= read -r; IFS= read -r; IFS= read -r
- done
Add Comment
Please, Sign In to add comment