I'm using a terminal program called espeak to convert a string of words into International Phonetic Alphabet (IPA). The main command is:
espeak -v fr --ipa "<string of words>"
Note that the text itself should be in quotations, since espeak -v fr --ipa "Je suis"
will give the correct IPA transcription, but espeak -v fr --ipa Je suis
will only give the transcription for "Je".
To avoid retyping the same commands every time, I defined the following function in my .bashrc
:
function fr {
espeak -v fr --ipa "$@"
}
However, when I run fr Je suis
(without quotations) in my terminal, I only get the result for "Je", even though I have nested the input argument $@
in quotations. Furthermore, when I added echo "$@"
within the function, it still prints as "Je suis".
How can I get the function to output the result for the whole string (with white space and new line characters), and not just the first word? Thank you.