Differences between version 36 and predecessor to the previous major change of BenStaz.
Other diffs: Previous Revision, Previous Author, or view the Annotated Edit History
Newer page: | version 36 | Last edited on Friday, June 8, 2007 1:09:51 am | by BenStaz | Revert |
Older page: | version 35 | Last edited on Friday, June 8, 2007 1:01:38 am | by AristotlePagaltzis | Revert |
@@ -32,15 +32,4 @@
* [x2x]
* [VMWareNotes]
* [FglrxNotes]
* [BcNotes]
-
-!Random Bash Script I Just Wrote
-<verbatim>
-IFS=$'\n'; lines=($(aptitude search ~g)) count=${#lines[@]}; random_index=$((RANDOM % count)); echo "${lines[random_index]}"
-</verbatim>
-
- More easily:
- <verbatim>
- aptitude search ~g | while read ; do echo "$RANDOM $REPLY" ; done | sort -n | head -1 | cut -d' ' -f2-
- </verbatim>
- —AristotlePagaltzis