Bash-Script Problem: a=$(cat $1) [SOLVED]
Posted: Mon Jun 05, 2017 9:46 am
Hi guys,
i've just started to learn a bit about Bash-Scripting and i've tried to make a script on my own but unfortunately it's not working as it should :/
Here is the script:
My intension is to replace every german additional character (äüöß) with the international letters(au,ue,oe,ss). The Input should be read from a .txt file, which should be the 1 parameter of this command. At the end of the user should see the content of the file but with the replaced characters.
My problem is that removes the free passages. So for Example the text file:
"Hello
World"
will be shown in the terminal by this command as "Hello World". Thats changing the style of the file but thats not my intesion. It should only replace the additional characters
Greets Kaczo
i've just started to learn a bit about Bash-Scripting and i've tried to make a script on my own but unfortunately it's not working as it should :/
Here is the script:
Code: Select all
#!/bin/bash
a=$(cat "$1")
echo $a
a=${a//ä/ae}
a=${a//ü/ue}
a=${a//ö/oe}
a=${a//ß/ss}
echo $a
My problem is that
Code: Select all
a=$(cat "$1")
"Hello
World"
will be shown in the terminal by this command as "Hello World". Thats changing the style of the file but thats not my intesion. It should only replace the additional characters
Greets Kaczo