I have a text line that looks like this (there is a space after "poseidon"):
/usr/share/geoserver/data_dir/workspaces/poseidon public/odense_kommune/datastore.xml:17:host">a-postgis1.gues.com</entry>
and I use this to delete everything after the first ":"
filename=$(sed 's/\:.*$//' <<< $myHost)
The result is :
/usr/share/geoserver/data_dir/workspaces/poseidon
public/datastore.xml
and it should have been :
/usr/share/geoserver/data_dir/workspaces/poseidon public/datastore.xml
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
$myHost
? – pLumo Oct 23 '18 at 14:28echo "$myHost" | od -c
– glenn jackman Oct 23 '18 at 16:17