Simpler Navigation for Servers and Operating Systems - Please Update Your Bookmarks
Completed: a much simpler Servers and Operating Systems section of the Community. We combined many of the older boards, so you won't have to click through so many levels to get at the information you need. Check the consolidated boards here as many sub-forums are now single boards.
If you have bookmarked forums or discussion boards in Servers and Operating Systems, we suggest you check and update them as needed.
cancel
Showing results for 
Search instead for 
Did you mean: 

echodo not working.

SOLVED
Go to solution
Colin Summers
Occasional Visitor

echodo not working.

I have several scripts that use echodo. 4 some reason they have stopped working and it's the echodo that is failing. I have tested this on the command line and found that all of the commands, ie cat ls -al, mkdir, rmdir, work EXCEPT export.
example:
1.echodo ls -l /tmp - this works
2. echodo mkdir /tmp/colin - this works
3. echodo export COLIN="TEST77" then I echo $COLIN and it's empty.
I can't figure out why. No changes to the O/S. Any ideas would be of great help.
Thank you all in advance.
4 REPLIES
linuxfan
Honored Contributor

Re: echodo not working.

Hi Colin,


AFAIK, there is no such command called echodo
you might be using an alias or a wrapper script.
Can you do "type echodo" or "whence echodo" or "which echodo" and see what is echodo

If it is an alias "type echodo" will return
echodo is an alias for .......

-Ramesh
They think they know but don't. At least I know I don't know - Socrates
Colin Summers
Occasional Visitor

Re: echodo not working.

Ramesh:
I did all 3 of your commands and they returned the same thing. /p/util/oracle/8.0.6/bin/echodo
Here are the only 2 working lines in the echodo script.

echo $*
$*
This should be echoing the command and then execute it.
Thanx.
Graham Cameron_1
Honored Contributor
Solution

Re: echodo not working.

echodo is a script supplied as part of the
oracle distribution, so is not standard hp-ux.
All it does is to echo a command and then
execute it, using:
echo $*
$*

Since it is a script, each time it is invoked
it runs in its own subshell, so your
"export COLIN=TEST77" command *does* get
executed, but within its own subshell which then immediately exits.

When you do "echo $COLIN" from the calling
shell, COLIN is therefore undefined.

Therefore echodo is of no use if you are issuing commands which affect the shell environment.

echodo always works this way, nothing has changed on your system. The only way round it is to take out the echodo before the export.
How about
export COLIN="TEST77"
echo $COLIN
in your script.
Hope this helps.
Graham
Computers make it easier to do a lot of things, but most of the things they make it easier to do don't need to be done.
linuxfan
Honored Contributor

Re: echodo not working.

Hi Colin,

Graham has already explained to you as to why your variable is not getting set in your shell, I just wanted to add that if you are trying to set a variable just add it to user's .profile in $HOME/.profile

-HTH
Ramesh
They think they know but don't. At least I know I don't know - Socrates