diff --git a/pokemonsay.sh b/pokemonsay.sh index 94c6e506..2f0fdca0 100755 --- a/pokemonsay.sh +++ b/pokemonsay.sh @@ -27,16 +27,16 @@ usage() { } # Where the pokemon are. -pokemon_path=`pwd`/cows +pokemon_path="$(pwd)/cows" list_pokemon() { echo "Pokémon available in '$pokemon_path/':" echo all_pokemon="$(find $pokemon_path -name "*.cow" | sort)" echo "$all_pokemon" | while read pokemon; do - pokemon=${pokemon##*/} - pokemon=${pokemon%.cow} - echo $pokemon + pokemon="${pokemon##*/}" + pokemon="${pokemon%.cow}" + echo "$pokemon" done exit 0 } @@ -108,15 +108,15 @@ fi # Define which pokemon should be displayed. if [ -n "$POKEMON_NAME" ]; then - pokemon_cow=$(find $pokemon_path -name "$POKEMON_NAME.cow") + pokemon_cow="$(find "$pokemon_path" -name "$POKEMON_NAME.cow")" elif [ -n "$COW_FILE" ]; then pokemon_cow="$COW_FILE" else - pokemon_cow=$(find $pokemon_path -name "*.cow" | shuf -n1) + pokemon_cow="$(find "$pokemon_path" -name "*.cow" | shuf -n1)" fi # Get the pokemon name. -filename=$(basename "$pokemon_cow") +filename="$(basename "$pokemon_cow")" pokemon_name="${filename%.*}" # Call cowsay or cowthink. @@ -128,5 +128,5 @@ fi # Write the pokemon name, unless requested otherwise. if [ -z "$DISPLAY_NAME" ]; then - echo $pokemon_name + echo "$pokemon_name" fi diff --git a/scrap_data.sh b/scrap_data.sh index d35e097a..11fc4f8b 100755 --- a/scrap_data.sh +++ b/scrap_data.sh @@ -6,7 +6,7 @@ bulbapedia_page_url="http://bulbapedia.bulbagarden.net/wiki/List_of_Pok%C3%A9mon_by_Kanto_Pok%C3%A9dex_number" bulbapedia_page_name="bulbapedia.html" -scrap_folder="`pwd`/scrapped-data" +scrap_folder="$(pwd)/scrapped-data" # Make sure the directory for the scrapped data is there. mkdir -p "$scrap_folder" @@ -18,7 +18,7 @@ if [ ! -e "scrapped-data/bulbapedia.html" ]; then echo " > Downloaded." fi -# Dear furure me, +# Dear future me, # # If you are in need to maintain this part of the code... I am # realy sorry for you (T.T). This was the best I could do... But