Skip to content

Instantly share code, notes, and snippets.

@kalimalrazif
Created February 26, 2016 21:41
Show Gist options
  • Save kalimalrazif/e61cf1dbe3a5316ebc84 to your computer and use it in GitHub Desktop.
Save kalimalrazif/e61cf1dbe3a5316ebc84 to your computer and use it in GitHub Desktop.
Encontrar la palabra mas larga en un archivo
#!/bin/bash
for archivo in `find ./ -type f | grep php`; do
echo ------- $archivo -------;
cat $archivo | sed 's/ /\n/g' | sort | uniq | awk '{print length, $0}' | sort -nr | head;
echo ------- $archivo -------;
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment