/* Updated 11/29/09 16:55:51 by rob */
/* rexx routine to display hardware list in firefox */
/* Uses Zenity to get user's login password */
/*
trace ?a
*/
parse source system invocation s_id rest
h=lastpos("/",s_id)+1 /* Getting source file name and extension */
l=length(s_id)-h+1
s_fid=substr(s_id,lastpos("/",s_id)+1,length(s_id)-h+1) /* strip out
directories to get source fileid */
if pos(".",s_fid)>0 then do
s_fn=substr(s_fid,1,pos(".",s_fid)-1) /* Source filename is
everything to left of . */
end
else s_fn=s_fid /* no file extension */
/*
cmd='printenv > cron_env.txt'
cmd
user=value('USER', ,'SYSTEM'); /* Should be the userid in
linux, but */
/* USER is not available to
Cron */
/* use LOGNAME
instead. */
*/
user=value('LOGNAME', ,'SYSTEM'); /* Should be the userid in
linux */
text="""To generate an html formatted hardware list for "user" for
display in Firefox please provide your password to sudo."""
1>> cmd='zenity --entry --title='s_fn' --entry-text=" " --hide-text --
text='||text
2>> cmd
rcs=rc /* return code save */
if rcs = 1 then do
say "Cancelled."
end
else if rcs = 0 then do
cmd="sudo lshw -html > ~/hardware_info.html && firefox ~/
hardware_info.html"
cmd
end
else if rcs = -1 then do
say "An unexpected error has occurred."
end
else if rcs = 5 then do
say s_fn" has timed out."
end
call exit rcs
exit:
procedure expose rcs
exit rcs
Try one of the following:
/* call zenity as an external function*/
title = 'fred'
switches = '--entry --title="'title'" --hide-text'
ret = 'zenity'( switches )
Say ret
/* Use ADDRESS...WITH and write output to queue */
Address System 'zenity' switches With Output FIFO ''
Parse Pull ret
Say ret
/* Use Address...WITH and write output to stem variable */
Address System 'zenity' switches With Output STEM ret.
Say ret.1
Cheers, Mark
Thank you, Mark,
The 1st one still spits the user entry back to the terminal. The 2nd
two are what I wanted and was missing. I didn't try the stem
approach, but I am it will work the same as the stack approach.
Happy Trails, Rob
[snip]
>
> Thank you, Mark,
> The 1st one still spits the user entry back to the terminal. The 2nd
> two are what I wanted and was missing. I didn't try the stem approach,
> but I am it will work the same as the stack approach. Happy Trails, Rob
Hmm, the first one works here. What version of Regina are you running?
rob@fargo:~$ rexx -v
REXX-Regina_3.4 5.00 30 Dec 2007
The first suggestion works here as well. I just tried it again.
Sorry for the misinformation.
Rob