Skip to content

Commit

Permalink
create manrnd - get random man entry
Browse files Browse the repository at this point in the history
  • Loading branch information
skropf authored Oct 6, 2020
1 parent 24e7150 commit 93a6ef4
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions manrnd
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#!/bin/bash

IFS=':'

for p in $PATH
do
IFS=$'\n'

new_execs=($(ls $p))
all_execs=("${all_execs[@]}" "${new_execs[@]}")

IFS=':'
done

len=${#all_execs[@]}
choice=$(((5*RANDOM) % len))

man ${all_execs[$choice]}

0 comments on commit 93a6ef4

Please sign in to comment.