It is currently Sat, 26 Nov 2022 05:14:47 GMT

Author Message
 Initializing ksh variables
SunOS 5.8 Generic_108528-20 sun4u sparc SUNW,Ultra-60 running  ksh.

Coming from a HPUX environment.

In HP UX, not problem with initializing a variable


then assigning then redirecting standard error

somecommand 2> $somevariable

Using this method in the Solaris environment creates a file called 0 with
the contents of  somecommand 2> $somevariable .

Am I missing something ?

begin 666 cvidal.vcf
M; T*14U!24P[4%)%1CM)3E1%4DY%5#IC=FED86Q 871T+F-O;0T*4D56.C(P
;,#,P-S X5#$Y,3 R.%H-"D5.1#I60T%21 T*

 Sun, 25 Dec 2005 03:10:28 GMT   
 Initializing ksh variables
Actually, this situiation is the same in HPUX.


 Sun, 25 Dec 2005 03:26:02 GMT   
 Initializing ksh variables


I would create a temporary file if you also need stdout:

command 2>/tmp/command.err
variable=`cat /tmp/command.err`

Or if you want both (stderr and stdout) in the variable

variable=`command 2>&1`

Or if you don't want stdout and only stderr use:

variable=`command 2>&1 >/dev/null`


-- Olaf Bohlen --------------------- cell +49-172-4561817 --
-- Graefenberger Str. 51 -- mail <> --
-- 91054 Buckenhof ------ http --
-- Germany ---------------------- irc firefox01 (IRC-Net) --

 Sun, 25 Dec 2005 18:59:52 GMT   
   [ 3 post ] 

Similar Threads

1. Using a variable in a variable name in KSH

2. ksh: Need to read variables into variables

3. initialize the global variables in .so files

4. Initializing variables

5. initializing a variable and simultaneously keeping terminal output

6. How do I read a ini file to initialize variables

7. initializing a global variable at apache startup

8. How to initialize complex per-cpu variables?

9. New to Linux: how are dev variables initialized?

10. enviroment variables in ksh

Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by ST Software