Hello everyone,
I understand that using >> I'm able to append lines to a file ...
Is it also possible to append words to the same line in the file somehow ?
e.g.:
hostname >> /file
cat /etc/hosts | grep 172 | awk '{ print $1 }' >> /file
This would generate let's say the following file content:
server
172.16.238.34
But I want it to look like this when I do a "cat /file":
server 172.16.238.34
Is it possible ?
Regards
Thomas
I understand that using >> I'm able to append lines to a file ...
Is it also possible to append words to the same line in the file somehow ?
e.g.:
hostname >> /file
cat /etc/hosts | grep 172 | awk '{ print $1 }' >> /file
This would generate let's say the following file content:
server
172.16.238.34
But I want it to look like this when I do a "cat /file":
server 172.16.238.34
Is it possible ?
Regards
Thomas