File: xjig-random

package info (click to toggle)
xjig 2.4-8
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 420 kB
  • ctags: 1,316
  • sloc: cpp: 4,533; makefile: 983; sh: 14; perl: 5
file content (15 lines) | stat: -rw-r--r-- 382 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@debian.org> 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";