Assigning a Value to Null Variables (sh)

Assigning a Value to Null Variables (sh)

Post by Keith Tonge » Tue, 11 Feb 1997 04:00:00



Is it more efficient to assign a value to a variable without a value
like this:

a=${a:-"SomeValue"}

        -or this -

:${a:="SomeValue"}

Or is it simply a matter of coding style?

        ...kt
-------------------------------------------------------
Pleas reply to        |         ||     _||_
Keith Tonge' at:      |         || // |_  _|
                      |         ||/<    ||

                      | "Do or do not. There is no try"
-------------------------------------------------------

 
 
 

1. assign a value in a variable in sh

Hello all,

I have a simple problem,

In an sh script i have to get  values (string and int) to put in  two
variables

These values can be in two files with only this string or value in it

Or i can get it with a perl script that make a "print $variable;"

Can you help me ?

Thank's a lot,     :-)

Best regards from France,

Jacques Guellec
Web des lilas
http://perso.easynet.fr/~jguellec

Clean_Mail 2.07
http://www.linuxberg.com
http://perso.easynet.fr/~jguellec/program/perl/clean_mail/clean_mail.htm

Note de cours du CNAM
http://ariane.rio.net/~guellec

2. Serial port access to console

3. detecting difference between unset variable and variable whose value is null in Korn Shell

4. Iomega Ditto Easy800 - setup help required

5. How to search for string and assign the value on next line to a variable

6. TV Card on Solaris (Not holding my breath)

7. Assigning an exit value to a Bourne shell variable?

8. compiling KDE 2.0 on solaris box

9. Assigning a variable a value with the "time" command

10. Assigning a variable value in a script question.

11. assigning a value returned from a function to a variable

12. Help!How to assign a value to a variable in awk

13. Assigning values to variables