D&C GLug - Home Page

[ Date Index ] [ Thread Index ] [ <= Previous by date / thread ] [ Next by date / thread => ]

Re: [LUG] bash shell script question

 

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1



On 02/01/15 17:00, Martijn Grooten wrote:
> On Fri, Jan 02, 2015 at 04:57:53PM +0000, Martijn Grooten wrote:
>> On Fri, Jan 02, 2015 at 04:47:41PM +0000, Paul Sutton wrote:
>>> 1.  Put the out put to hostname -I as a variable and display
>>> that OR 2   put the output as an environment variable e.g
>>> $HOSTNAME and display that
>>> 
>>> Just not sure on HOW to do this
>> 
>> hostname=`hostname -I`; echo "Hostname: $hostname"
> 
> Actually,
> 
> echo "hostname:" `hostname -I`
> 
> is much better, and is a proper answer to 1.
> 
> Martijn.
> 


Thank you for this Martijn, works great,

I will credit you in my final shell script

Paul
- -- 
http://www.zleap.net @zleap14
@zleap14  diaspora : zleap@xxxxxxxxxxxxxxxx
Documentation lead @ ToriOS http://www.torios.org
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1

iEYEARECAAYFAlSm2VoACgkQaggq1k2FJq2FNwCglnpw3/xveqTxf8DtFbDf3E6l
jj0AnRGQbSiD69+zarusEjfLZRlK67M5
=1ISp
-----END PGP SIGNATURE-----

-- 
The Mailing List for the Devon & Cornwall LUG
http://mailman.dclug.org.uk/listinfo/list
FAQ: http://www.dcglug.org.uk/listfaq