using command substitution from inittab?

using command substitution from inittab?

Post by rob.. » Fri, 19 Jul 1996 04:00:00

Hi, I execute a script from inittab passing one or two arguments.

The script needs to call "oraenv" which sets up an ORACLE_HOME environment variable
by using command subsitution with another script that it calls called dbhome that
echos out the path.

Anyway, if I do


echo $ORACLE_HOME > /tmp/somefile

when ever this script is executed from inittab there's nothing in $ORACLE_HOME.

NOTE: I can replace dbhome with a script like this

#! /bin/sh

echo robert

I'd expect to see "robert" in the /tmp/somefile but it too has nothing in it.

So, is this related to the lack of a terminal from inittab or something?

I mean earlier today I got _comments_ from my script appearing in my environment
under HP/UX which seemed very strange.

You are amazed that they exist and they burn so
bright whilst you can only wonder why.


1. Command Substitution within Parameter Substitution?


(GNU bash, version 2.05b.0(1)-release (i586-mandrake-linux-gnu).)

Is it possible, in the above version of BASH, to have (a) command
substitution(s) within (a) parameter substitution(s)?  I tried the
following in a BASH script:

gqview ${$( cat $HOME/mydisplay_return )#*\ }

and it didn't work.  The above code line was to execute GQview (an image
viewer) with the name of an image file that was stored, on it's own, in a
file called 'mydisplay_return', hence the 'cat' command to get at the image
file name.  The file name stored in the 'mydisplay_return' file was
prefixed with an identifying number followed by a space, hence the '#*\ '
parameter substitution to just leave the file name.  But it doesn't work.
What's wrong?

Gary Hayward.

2. lastcomm and the /var/pacct files

3. command substitution using sed

4. CCEVS Interpretation Mailing Lists

5. Command substitution in rsh-command

6. BinkleyTerm

7. Substitution within substitution- Is it possible?

8. Newish MMORPG development

9. nested command substitution in csh

10. Problem: Command substitution adds an extra carriage return character on return.

11. Newbie question: Nested command substitution???

12. command substitution

13. Multi-line command substitution (csh)