File: xjig-random

package info (click to toggle)
xjig 2.4-5
  • links: PTS
  • area: main
  • in suites: potato
  • size: 412 kB
  • ctags: 1,155
  • sloc: cpp: 4,534; makefile: 735; sh: 14; perl: 5
file content (15 lines) | stat: -rw-r--r-- 389 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#!/usr/bin/perl
#
# start xjig with a random image from /usr/lib/games/xjig/*
# or other directories
#
# Dave Holland <dave@zenda.demon.co.uk> 22 June 1999

srand;

@list = split(' ',`/bin/ls /usr/lib/games/xjig/* /usr/local/lib/games/xjig/* ~/.xjig/*`);

$index = rand @list;
chomp($file = $list[$index]);

exec "/usr/games/xjig",@ARGV,"-file","$file" || die "Couldn't start xjig: $!\n";