HI
I am trying to grep 3 characters from hostname and append a character at the end.
I tried as in the following:
Now I am trying to append "g" at the end of this output as in the following.
But I get output as "yug" but I require as "hyug"
Please help me to solve this.
Thanks in advance
I am trying to grep 3 characters from hostname and append a character at the end.
I tried as in the following:
Code:
root@abag3:~# hostname | cut -c1-3
hyu
Code:
root@abag3:~# hostname | cut -c1-3 | sed -s '/hyu/hyug'
hyu
yug
Please help me to solve this.
Thanks in advance