Created
May 31, 2023 08:20
-
-
Save victorgabrielbs/140811e491c620ef697fb0120ceb5aaf to your computer and use it in GitHub Desktop.
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/zsh | |
if [[ $# -eq 0 ]]; then | |
echo "Por favor, forneça um arquivo de texto como argumento." | |
exit 1 | |
fi | |
file_content=$(<"$1") | |
file_content=${file_content//$'\n'/ } | |
file_content=${file_content// / } | |
tokens=(${(s: :)file_content}) | |
echo "O arquivo contém ${#tokens} tokens." |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment