BASH query

Brian Fahrlander brian at fahrlander.net
Wed Jul 11 20:30:11 UTC 2007


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

dave selby wrote:
> Hi all,
> 
> I need to set a BASH variable val to the contents of a small line of
> ASCII in a file called 'version',
> 
> ie something like ...
> 
> val=$(cat version)
> 
> except the above does not work !!

    I'll bet there are dozens of ways, but this should work:

    val=`cat version`

    (Those are back-ticks; on many keyboards it's near the "1" key.)
- --
 ------------------------------------------------------------------------
 Brian Fahrländer                 Christian, Conservative, and Technomad
 Evansville, IN                              http://Fahrlander.net/brian
 ICQ: 5119262                         AOL/Yahoo/GoogleTalk: WheelDweller
 ------------------------------------------------------------------------
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2.2 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFGlT3T6PLtRzZbdhYRAldgAJ9YM83hY5u9HrwoU4IDpFDZ5rA5lgCcDNGl
tqmfWA5rnzJ8bWTdUbrLVVk=
=RsWQ
-----END PGP SIGNATURE-----




More information about the ubuntu-users mailing list