Hi David,

This is in response to your suggested solution.
Part of this below mail is sent to mail list for another response.
Results of your suggested solutions are at end of the mail.

"history" is aliased to 'fc -l' as you can see below.

                [test:~]$alias
                alias history='fc -l'
                alias l.='ls -d .* --color=tty'
                alias ll='ls -l --color=tty'
                alias ls='ls --color=tty'
                alias perl='/usr/bin/perl5.8.5'
                alias which='alias | /usr/bin/which --tty-only
--read-alias --show-dot --show-tilde'


Here if "history" is executed with STAF it doesn't return anything.
(Please note that this is not executed on remote machine for which this
thread has been started)
                

                [test:~]$STAF local PROCESS  START SHELL COMMAND
"history" returnstdout stderrtostdout wait Response
                --------
                {
                  Return Code: 0
                  Key        : <None>
                  Files      : [
                    {
                      Return Code: 0
                      Data       :
                    }
                  ]
                }

Executing "history" without staf returns results.
                
                [test:~]$history
                1049     cd
                1050     whoami
                1051     ls
                1052     ls
                1053     ls
                1054     ls
                1055     history
                1056     ls
                1057     ls
                1058     sl
                1059     ls
                1060     ls
                1061     history
                1062     alias
                1063     STAF local process start shell returnstdout
wait command alias
                1064     alias
                1065     STAF local PROCESS  START SHELL COMMAND
"history" returnstdout stderrtostdout wait
                [test:~]$


Now If "history" is executed as you suggested following is the result. 

                [test:~]$STAF local PROCESS  START SHELL COMMAND
"`history`" returnstdout stderrtostdout wait
                Response
                --------
                {
                  Return Code: 127
                  Key        : <None>
                  Files      : [
                    {
                      Return Code: 0
                      Data       : sh: 1050: command not found
                sh: line 1: 1051: command not found
                sh: line 2: 1052: command not found
                sh: line 3: 1053: command not found
                sh: line 4: 1054: command not found
                sh: line 5: 1055: command not found
                sh: line 6: 1056: command not found
                sh: line 7: 1057: command not found
                sh: line 8: 1058: command not found
                sh: line 9: 1059: command not found
                sh: line 10: 1060: command not found
                sh: line 11: 1061: command not found
                sh: line 12: 1062: command not found
                sh: line 13: 1063: command not found
                sh: line 14: 1064: command not found
                sh: line 15: 1065: command not found
                sh: line 16: 1066: command not found

                    }
                  ]
                }
                [test:~]$STAF local PROCESS  START SHELL COMMAND "echo
`history`" returnstdout stderrtostdout wait
                Response
                --------
                {
                  Return Code: 127
                  Key        : <None>
                  Files      : [
                    {
                      Return Code: 0
                      Data       : 1051 ls
                sh: line 1: 1052: command not found
                sh: line 2: 1053: command not found
                sh: line 3: 1054: command not found
                sh: line 4: 1055: command not found
                sh: line 5: 1056: command not found
                sh: line 6: 1057: command not found
                sh: line 7: 1058: command not found
                sh: line 8: 1059: command not found
                sh: line 9: 1060: command not found
                sh: line 10: 1061: command not found
                sh: line 11: 1062: command not found
                sh: line 12: 1063: command not found
                sh: line 13: 1064: command not found
                sh: line 14: 1065: command not found
                sh: line 15: 1066: command not found
                sh: line 16: 1067: command not found

                    }
                  ]
                }


Thanks,
Uma.

------------------------------
I don't think this has anything to do with the alias being defined in
the profile.  I can reproduce the problem just from some command line
requests.  Here is what I  found (on a  Linux system), including a
workaround.

First, define an alias (have "osname" run the "uname" command): 

# osname
-bash: osname: command not found

# uname
Linux

# alias osname=uname

# osname
Linux
 
Using "osname" as the PROCESS COMMAND results in an error similar to
yours:
 
# STAF local PROCESS START SHELL COMMAND "osname" RETURNSTDOUT
STDERRTOSTDOUT WAIT Response
--------
{
  Return Code: 127
  Key        : <None>
  Files      : [
    {
      Return Code: 0
      Data       : sh: osname: command not found

    }
  ]
}

If we use backticks around osname, then that does execute the aliased
command, but then the shell tries to execute the output (in this case
"Linux"):

# STAF local PROCESS START SHELL COMMAND "`osname`" RETURNSTDOUT
STDERRTOSTDOUT WAIT Response
--------
{
  Return Code: 127
  Key        : <None>
  Files      : [
    {
      Return Code: 0
      Data       : sh: Linux: command not found

    }
  ]
}

So, if you do something like "echo `osname`", that works:

# STAF local PROCESS START SHELL COMMAND "echo `osname`" RETURNSTDOUT
STDERRTOSTDOUT WAIT Response
--------
{
  Return Code: 0
  Key        : <None>
  Files      : [
    {
      Return Code: 0
      Data       : Linux

    }
  ]
}

Maybe someone else on the mailing list has a better solution.

Thanks,
David 

David Bender
STAF/STAX Development
IBM Software Group, WPLC 
 
11501 Burnet Rd. 
Bldg. 903-5B002
Austin, TX 78758-3400 
 
Phone (T/L): 1-512-286-5315 (363-5315)
ITN: 23635315
Email: bda...@us.ibm.com 
 


--
Uma.

------------------------------------------------------------------------------
Throughout its 18-year history, RSA Conference consistently attracts the
world's best and brightest in the field, creating opportunities for Conference
attendees to learn about information security's most important issues through
interactions with peers, luminaries and emerging and established companies.
http://p.sf.net/sfu/rsaconf-dev2dev
_______________________________________________
staf-users mailing list
staf-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/staf-users

Reply via email to