Issue #1240: replaced cut with awk

This commit is contained in:
Carl Pulley 2013-01-25 11:31:18 +00:00
parent eedd8a26db
commit 4b64563f97
9 changed files with 9 additions and 9 deletions

View File

@ -116,7 +116,7 @@ function ensure_netutils_yum() {
# the /etc/hosts file, or they won't operate
function ensure_hostname_in_hosts() {
[ -n "$SSH_CONNECTION" ] && {
local ipaddr=`echo $SSH_CONNECTION | cut -d ' ' -f 3`
local ipaddr=`echo $SSH_CONNECTION | awk '{print $3}'`
} || {
local ipaddr=`hostname -i`
}

View File

@ -116,7 +116,7 @@ function ensure_netutils_yum() {
# the /etc/hosts file, or they won't operate
function ensure_hostname_in_hosts() {
[ -n "$SSH_CONNECTION" ] && {
local ipaddr=`echo $SSH_CONNECTION | cut -d ' ' -f 3`
local ipaddr=`echo $SSH_CONNECTION | awk '{print $3}'`
} || {
local ipaddr=`hostname -i`
}

View File

@ -116,7 +116,7 @@ function ensure_netutils_yum() {
# the /etc/hosts file, or they won't operate
function ensure_hostname_in_hosts() {
[ -n "$SSH_CONNECTION" ] && {
local ipaddr=`echo $SSH_CONNECTION | cut -d ' ' -f 3`
local ipaddr=`echo $SSH_CONNECTION | awk '{print $3}'`
} || {
local ipaddr=`hostname -i`
}

View File

@ -113,7 +113,7 @@ function ensure_netutils_yum() {
# the /etc/hosts file, or they won't operate
function ensure_hostname_in_hosts() {
[ -n "$SSH_CONNECTION" ] && {
local ipaddr=`echo $SSH_CONNECTION | cut -d ' ' -f 3`
local ipaddr=`echo $SSH_CONNECTION | awk '{print $3}'`
} || {
local ipaddr=`hostname -i`
}

View File

@ -31,7 +31,7 @@ function ensure_netutils_yum() {
# the /etc/hosts file, or they won't operate
function ensure_hostname_in_hosts() {
[ -n "$SSH_CONNECTION" ] && {
local ipaddr=`echo $SSH_CONNECTION | cut -d ' ' -f 3`
local ipaddr=`echo $SSH_CONNECTION | awk '{print $3}'`
} || {
local ipaddr=`hostname -i`
}

View File

@ -116,7 +116,7 @@ function ensure_netutils_yum() {
# the /etc/hosts file, or they won't operate
function ensure_hostname_in_hosts() {
[ -n "$SSH_CONNECTION" ] && {
local ipaddr=`echo $SSH_CONNECTION | cut -d ' ' -f 3`
local ipaddr=`echo $SSH_CONNECTION | awk '{print $3}'`
} || {
local ipaddr=`hostname -i`
}

View File

@ -116,7 +116,7 @@ function ensure_netutils_yum() {
# the /etc/hosts file, or they won't operate
function ensure_hostname_in_hosts() {
[ -n "$SSH_CONNECTION" ] && {
local ipaddr=`echo $SSH_CONNECTION | cut -d ' ' -f 3`
local ipaddr=`echo $SSH_CONNECTION | awk '{print $3}'`
} || {
local ipaddr=`hostname -i`
}

View File

@ -116,7 +116,7 @@ function ensure_netutils_yum() {
# the /etc/hosts file, or they won't operate
function ensure_hostname_in_hosts() {
[ -n "$SSH_CONNECTION" ] && {
local ipaddr=`echo $SSH_CONNECTION | cut -d ' ' -f 3`
local ipaddr=`echo $SSH_CONNECTION | awk '{print $3}'`
} || {
local ipaddr=`hostname -i`
}

View File

@ -116,7 +116,7 @@ function ensure_netutils_yum() {
# the /etc/hosts file, or they won't operate
function ensure_hostname_in_hosts() {
[ -n "$SSH_CONNECTION" ] && {
local ipaddr=`echo $SSH_CONNECTION | cut -d ' ' -f 3`
local ipaddr=`echo $SSH_CONNECTION | awk '{print $3}'`
} || {
local ipaddr=`hostname -i`
}