Here is my simple script:
#!/bin/ksh
host=`hostname`
cat /etc/passwd | awk -F: '{if($3 == 0) print $1,"- $host"}'
Here is the output:
root - $host
The output I'm looking for is (the name of the host is tech3):
root - tech3
Apparently, awk is interpreting my “- $host”. What am I doing wrong? Thanks.
Shane
#!/bin/ksh
host=`hostname`
cat /etc/passwd | awk -F: '{if($3 == 0) print $1,"- $host"}'
Here is the output:
root - $host
The output I'm looking for is (the name of the host is tech3):
root - tech3
Apparently, awk is interpreting my “- $host”. What am I doing wrong? Thanks.
Shane