I have a text line that looks like this (there is a space after "poseidon"):
and I use this to delete everything after the first ":"
filename=$(sed 's/\:.*$//' <<< $myHost)
The result is :
and it should have been :
it replaces the space with with a new line
I have tried with several SED options but can't figure out what is wrong.
I use the above like this :
filename=$(sed 's/\:.*$//' <<< $myHost) echo Filnavn : $filename >> filn.txt