command: Hostname output FQDN and not hostname

SUSE 11 SP4
command: hostname give output as FQDN and not Hostname alone.
/etc/hosts has IP, FQDN and hostname defined.

Checked in Yast, hostname and domain name is defined correctly.

How to correct output of command ‘hostname’. I only need hostname as output and not FQDN.

[QUOTE=sud87gupta;59737]SUSE 11 SP4
command: hostname give output as FQDN and not Hostname alone.
/etc/hosts has IP, FQDN and hostname defined.

Checked in Yast, hostname and domain name is defined correctly.

How to correct output of command ‘hostname’. I only need hostname as output and not FQDN.[/QUOTE]
Hi and welcome to the Forum :slight_smile:
In YaST did you check the add host to loopback? Or manually add to /etc/hosts;

127.0.0.2 hostname.example.com hostname

Did you check the output from the hostnamectl command? You can always use hostname -s if it’s in a script?