sh

ConorDoesItAll

·

printWordsNoLetters.sh

·

SH

·

Total Size: 260 B

·

·

Created: 4 years ago

·

Edited: 4 years ago

#!/usr/bin/env bash #Script using egrep to print random words with the user chosen amount of letters WordFile=./text.txt echo How many letters should the outputed word/words have? read noLetters grep -E -w '^[[:alpha:]]{$noLetters}' $WordFiles echo noLetters

3 bits

1371 views

Are you sure you want to delete?

User Profile Picture

This is cool!

ConorDoesItAll

14-04-2019 15:57:23

Thank you. It's very basic I'm currently learning Bash!

dan

14-04-2019 16:00:35

Thank you ConorDoesItAll, very cool!

embluk

14-04-2019 16:09:12

Hopefully CodeClippet is useful for you! :)

User Profile Picture

When I run the script grep does not return anything. Any ideas? I can substitute '$noLetters' for a value such as '4' and it will work.

User Profile Picture

Still looking fresh!

embluk

25-09-2020 19:01:17

Yeah man!

User Profile Picture

Hello! This is my first comment in a long time!