The UNIX and Linux Forums
>
Top Forums
>
Shell Programming and Scripting
Simple grep Question
.
User Name
Remember Me?
Password
google unix.com
Forums
Register
Forum Rules
Links
Albums
FAQ
Members List
Calendar
Search
Today's Posts
Mark Forums Read
Thread
:
Simple grep Question
View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
#
6
(
permalink
)
11-17-2008
Christoph Spohr
Registered User
Join Date: Sep 2008
Posts: 205
Hi,
keep it simple. A little test is enough:
[[ -s /etc/resolv.conf ]] &&
dns
=( $(awk '/nameserver/{print $2}' /etc/resolv.conf ) )
This means:
if /etc/resolv.conf exists and is not empty, then and only then execute the following command.
Kind regards
Chris
Christoph Spohr
View Public Profile
Find all posts by Christoph Spohr
Find Christoph Spohr's past nominations received
Find Christoph Spohr's present nominations given