Created
September 20, 2013 15:56
-
-
Save kennyyu/6639714 to your computer and use it in GitHub Desktop.
edit N random files
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
if [ -z "$1" ] | |
then | |
echo "usage: $0 N" | |
exit 1 | |
fi | |
N=$1 | |
files=$(find /home/passifist/linux-2.4.29 | grep "\.[ch]") | |
files=$(shuf --echo $files) | |
arr=($files) | |
sliced=("${arr[@]:0:$N}") | |
for file in "${sliced[@]}" | |
do | |
echo -e "\n// MY COOL EDITS" >> $file | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment