Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Apr 30th, 2012  |  syntax: None  |  size: 0.28 KB  |  hits: 12  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. #! /bin/sh
  2. dir=' /home/benutzer/ordner ' #PFAD ANPASSEN
  3. n_files=`/bin/ls -1 "$dir" | wc -l | cut -f1`
  4. rand_num=`awk "BEGIN{srand();print int($n_files * rand()) + 1;}"`
  5. file=`/bin/ls -1 "$dir" | sed -ne "${rand_num}p"`
  6. path=`cd $dir && echo "$PWD/$file"`
  7. vlc "$path" #GGF. ANWENDUNG ANPASSEN