"catching" a prompt for user input and answering it through zenity?

I'm trying to write a script (or multiple scripts) that will allow me to use command-line only applications via user defined actions in my file manager without having to open a terminal. Now I realize this basic functionality is already available, but as it stands I am unable to respond to command-line prompts for user input without opening a terminal. Is it possible to write a shell script that would act as a wrapper and allow me to use zenity (or another popup program) to respond to such queries?
For example if I used a command-line program that prompted me for a password, could I "catch" that prompt with a shell script and answer it through another program, such as zenity?
Last edited by falconheart (2011-01-16 22:37:25)

The easier way to do this is to collect the info with zenity first, then pass it on the command line.  If the program insists on prompting, then you could try feeding it the info with redirection if it accepts it from stdin.  For example
command < info.txt
where info.txt is a temp file created by your script which contains whatever you want entered into the prompts.  This will work in some cases.

Similar Messages

  • How to prompt for user input in Forms

    How do I prompt for user input in Forms?
    I am writing a piece of code where the user may choose, by clicking either of three buttons on an alert, to have the system assign a value to a variable, to input a value or to do neither?
    If the user chooses to input the value I want to update a set of database fields with the value.
    I have thought about showing a view where the value may be entered into a field displayed on that view. The value will be assigned to the variable by the user clicking a command button. The question I have in this case though, is whether, after the command button is clicked, control will be passed back to the code that called the view in the first place?

    Desgordon,
    This can be accomplished by displaying your message to the user using an Alert. I use 3 different Alerts (Note, Caution and Stop) in my forms and they are inherited from a central source file (such as an Object Library or a Template Form) so they can be used by all of my Forms. You can set the text of the Alert using the SET_ALERT_PROPERTY() built-in and capture what button the user presses with the SHOW_ALERT() built-in. Additionally, if you need more than one button to be displayed in an alert, you use the SET_ALERT_BUTTON_PROPERTY() built-in to rename the default button or to add up to a total of three buttons in the alert. Here's an example:
    DECLARE
       Alert_ID       ALERT;
       v_AlertType    VARCHAR2(10) := 'CAUTION';
       v_AlertTitle     VARCHAR2(25);
       v_AlertText    VARCHAR2(150);
       n_AlertButton  NUMBER;
    BEGIN
       v_AlertTitle := 'Title of Alert';
       v_AlertText := 'This is message to the user.';
       /* Code leading up to the decision point. */
       alert_id := FIND_ALERT(v_AlertType);
       /* Note: I only set the Label of Button 2 because the default button 1 label is 'OK' */
       SET_ALERT_BUTTON_PROPERTY(v_AlertType, ALERT_BUTTON2, LABEL, 'Cancel');
       SET_ALERT_PROPERTY(Alert_ID, v_AlertTitle, v_AlertText);
       n_AlertButton := SHOW_ALERT(Alert_ID);
      /* Now I can test the value of n_AlertButton for 1 or 2 to find out what button the user selected. */
      IF ( n_AlertButton = 1 ) THEN
         /* Do something, because the user selected 'OK' */
      ELSE
         /* It is assumed at this point that the user selected 'CANCEL' */
         /* Stop processing any further. */
         RAISE form_trigger_error;
      END IF;
    END:Hope this helps.
    Craig...
    -- If my response or the response of another answers your question, please mark the response accordingly. Thanks!

  • ADF security - prompt for user id and password again on page forward

    Hi,
    I am working with ADF using JDeveloper 10.1.3 with Business Components and ADF Faces.
    I have a Search page and a List page.
    Both pages are based on the same view within the same application module.
    The Search page is using the default Find and Execute Operations.
    The Execute button has an action that navigate to the List screen.
    faces-config.xml
    <navigation-rule>
    <from-view-id>/jspx/search.jspx</from-view-id>
    <navigation-case>
    <from-outcome>search</from-outcome>
    <to-view-id>/jspx/list.jspx</to-view-id>
    <redirect/>
    </navigation-case>
    </navigation-rule>
    <navigation-rule>
    <from-view-id>/jspx/list.jspx</from-view-id>
    <navigation-case>
    <from-outcome>find</from-outcome>
    <to-view-id>/jspx/search.jspx</to-view-id>
    <redirect/>
    </navigation-case>
    </navigation-rule>
    Security (Roles and Users) is based on the jazn-data.xml and web.xml
    URL Patterns for the pages have assigned to the role.
    Login Configuration is HTTP Digest Authentication
    <web-resource-collection>
    <web-resource-name>APP_SUPPORT</web-resource-name>
    <url-pattern>faces/jspx/search.jspx</url-pattern>
    <url-pattern>faces/jspx/list.jspx</url-pattern>
    </web-resource-collection>
    <auth-constraint>
    <role-name>APP_SUPPORT</role-name>
    </auth-constraint>
    <login-config>
    <auth-method>DIGEST</auth-method>
    </login-config>
    Everything is fine when running the application from JDeveloper,
    but when the application is deployed to the server (OC4J),
    After logging into the system, the Search page prompt for user id and password again
    on click of the Execute button.
    Have anyone experience this problem before?
    Thanks for any help.
    Jim

    Hi,
    does the same thing happen if you change your protected resource from:
    <web-resource-collection>
    <web-resource-name>APP_SUPPORT</web-resource-name>
    <url-pattern>faces/jspx/search.jspx</url-pattern>
    <url-pattern>faces/jspx/list.jspx</url-pattern>
    </web-resource-collection>to:
    <web-resource-collection>
    <web-resource-name>APP_SUPPORT</web-resource-name>
    <url-pattern>/faces/jspx/*</url-pattern>
    </web-resource-collection>Brenden

  • How to prompt for user input in PL/SQL

    How do I prompt for user input in PL/SQL?
    I am writing a piece of code where the user may choose, by clicking either of three buttons on an alert, to have the system assign a value to a variable, to input a value or to do neither?
    If the user chooses to input the value I want to update a set of database fields with the value.
    I have thought about showing a view where the value may be entered into a field displayed on that view. The value will be assigned to the variable by the user clicking a command button. The question I have in this case though, is whether, after the command button is clicked, control will be passed back to the code that called the view in the first place?
    Edited by: desgordon on Sep 3, 2008 10:33 AM

    desgordon wrote:
    How do I prompt for user input in PL/SQL?
    I am writing a piece of code where the user may choose, by clicking either of three buttons on an alert, to have the system assign a value to a variable, to input a value or to do neither?OK, you're doing that in Forms...
    >
    If the user chooses to input the value I want to update a set of database fields with the value.Write PL/SQL procedure for this purpose...
    >
    I have thought about showing a view where the value may be entered into a field displayed on that view. The value will be assigned to the variable by the user clicking a command button. The question I have in this case though, is whether, after the command button is clicked, control will be passed back to the code that called the view in the first place?Not clear what you mean with view?
    But if you call your procedure in that button then yes 'control will be passed back to the code'...
    Cheers!
    Edited by: Faust on Sep 3, 2008 7:57 PM
    Too slow...

  • AS/400 db2 database asks signon to AS/400 prompt for USER ID and PASSWORD when BO report is refreshed by client users

    Post Author: LalitJoshi
    CA Forum: Publishing
    I have created a report which is using  AS/400 db2 database.Connection is setup in a universe and through Client Access ODBC driver.
    Users are trying to connect AS/400 db2 system through ODBC(Client Access ODBC driver)  and full client BO 6.5.
    It asks for signon to AS/400 prompt for USER ID and PASSWORD when BO report is refreshed by users.
    Is there any way i can avoid the USER ID and PASSWORD as it is not feasible to give database USER ID and PASSWORD to each users.

    > SAPClassNotFoundException:
    > com.ddtek.jdbc.db2.DB2Driver
    It looks like your JDBC driver is not found. Have you deployed the driver to XI?
    <a href="https://www.sdn.sap.comhttp://www.sdn.sap.comhttp://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/3867a582-0401-0010-6cbf-9644e49f1a10">https://www.sdn.sap.comhttp://www.sdn.sap.comhttp://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/3867a582-0401-0010-6cbf-9644e49f1a10</a>

  • How to force sql developer to prompt for user input for every execution ?

    Hi Folks,
    Environment: Oracle 11g (on Windows 7)
    SQL Developer: *3.1.07*
    I am executing a PL/SQL code off Sql Developer. The code uses substitution variables to prompt user for input. However,I am only prompted for the user input for the very first run of the code. For the subsequent executions, the code simply picks up the user input from the very first run. This behavior persists for all subsequent runs of the code.
    I have executed the same piece of code from SQL*PLUS and the behavior seems normal (i.e. I am prompted for fresh input for every execution)
    How can flush out the old user input so I can be prompted for new user input for every run of the code in sql developer?
    Thanks in advance
    rogers42

    Hi Rogers42,
    1/try
    undefine
    undefine fred
    select '&&fred' from dual;
    [run this multiple times]
    [prompts gere]
    old:select '&&fred' from dual
    new:select 'a' from dual
    'A'
    a
    [prompts here]
    old:select '&&fred' from dual
    new:select 'b' from dual
    'B'
    b
    2/try
    exit (requires recent version of sql developer: tools->preferences->Database->worksheet->Re-initialize on script exit command)
    select '&&fred' from dual;
    exit
    run this multiple times
    [prompts here]
    old:select '&&fred' from dual
    new:select 'x' from dual
    'X'
    x
    Commit
    [prompts here]
    old:select '&&fred' from dual
    new:select 'y' from dual
    'Y'
    y
    Commit
    3/use &fred instead of &&fred
    For background see
    http://totierne.blogspot.co.uk/2010/04/substitution-and-bind-variables.html
    -Turloch
    SQLDeveloper team

  • Prompt For User Input in SQL Developer

    I am using the '&' in a very basic SQL select script, but I do not get a prompt for my input. However, i have used the '&' in update scripts and it does prompt me.
    For example:
    select DCC_DESCRIPTION
    from S_TBLDTMINOR
    where DCC_DTMINOR = &Minor;
    Gives an ORA-01008 error (not all variables bound).
    If it's a varchar field and I use '&Minor' - it executes with no error, but does not prompt for data. Please note:  this script works when it's run in SQL*Plus, but not in SQL Developer.
    If I execute:
    update S_TBLDTMINOR
    set DCC_DESCRIPTION = 'Mark & Wilson'
    where DCC_DTMINOR = 'AAA';
    It does prompt me for a value (but I do not want it to).
    So I know prompting works in SQL Developer, but it does not work in select statements.
    Is this a configuration setting I can change in SQL Developer? I know I can use the escape in the update statement to avoid the prompt, but I'm not concerned with that. I'm trying to get the prompting to work in the select statement.
    Edited by: user12289057 on Feb 23, 2012 11:17 AM

    Hi user12289057,
    1/Not sure what your testcase is (including table definition), I was trying to reproduce with:
    select * from dual where dummy = '&myin'
    2/Try
    undefine Minor
    to ensure Minor is not already set.
    3/Minor may need to be quoted if it is a string.
    Short blog post on substitution and bind variables.
    http://totierne.blogspot.com/2010/04/substitution-and-bind-variables.html
    -Turloch
    SQLDeveloper team.

  • Increasing max # of inputs on prompt for user input

    Hi
    I would like to increase the number of inputs beyond 10 available on the prompt user for input function. At the moment I am using 9 of the 10 available inputs each running a subVI from a case structure. I seem to be limited to 10 inputs using the prompt user for input function so is there another way of prompting the user to select from >10  inputs preferably 20. 
    Thanks for any help
    Chris
    Solved!
    Go to Solution.
    Attachments:
    WASP dialog.vi ‏57 KB

    You can always write you own dialog with as many selections as you like.
    Right-click the express VI and "open front panel" This will convert it to a VI that you can edit in any way you want. save it under a new name.
    You might even want to add some validation code, e.g. to make sure that no more than 2 boxes are checked.
    LabVIEW Champion . Do more with less code and in less time .

  • Prompting for user input in nested select statements

    I recently rewrote a query to use a nested select statement instead of specifying every SELECT field on the GROUP BY line.  Here's the query which works perfectly with hard-coded values of '030', '01/01/11', and '12/31/11'.
    SELECT T0.[CardName] AS Customer, T0.[CardCode] as 'Cust ID', T0.[Phone1] as Phone, T0.[CntctPrsn] as 'Contact Person', T0.[Address], T0.[City], T0.[State1] as State, T0.[ZipCode] as 'Zip Code', T0.[Country],  T1.[TotalSales]
    FROM OCRD T0 
    INNER JOIN
       (SELECT I.[CardCode] AS CardCode, SUM(I.[DocTotal]) AS TotalSales
        FROM OINV I
        WHERE left (I.[CardCode], 3) = '030' AND (I.[DocDate] >= '01/01/11' AND I.[DocDate] <= '12/31/11')
        GROUP BY I.[CardCode]) T1
    ON T0.[CardCode] = T1.[CardCode]
    ORDER BY T0.[CardName]
    When I try to prompt for the left 3 characters of the CardCode (or the dates), ie.
        WHERE left (I.[CardCode], 3) = [%0] AND (I.[DocDate] >= '01/01/11' AND I.[DocDate] <= '12/31/11')
    I get an error "Column 'OCRD.CardName' is invalid in the select list because it is not contained in either an aggregate function or the GROUP BY clause".
    It's like putting a user variable in the inner SELECT made it part of the outer SELECT which is exactly what I was trying to avoid by re-writing this query with the inner SELECT.
    Can anyone explain what SQL Server is doing here and how to fix it?

    Thanks Gordon.  That's how I originally wrote the query and it works fine.  But I was disturbed that I had to GROUP BY every field in my SELECT statement when I really only wanted to group by CardCode.  So I did some research and came up with this where the inner select still groups by only CardCode and still takes user input.  I don't really understand why you need the commented SELECT statements in the SET lines, but you do.  Something about using real table fields for variables.
    DECLARE @startDate datetime
    DECLARE @endDate datetime
    DECLARE @rep varchar(10)
    SET @rep /* SELECT T0.[CardCode] FROM ORDR T0 WHERE T0.[CardCode] */ = '[%0]'
    SET @startDate /* SELECT T0.[DocDate] FROM OINV T0 WHERE T0.[DocDate] */ = '[%1]'
    SET @endDate /* SELECT T0.[DocDate] FROM OINV T0 WHERE T0.[DocDate] */ = '[%2]'
    SELECT T0.[CardName] AS Customer, T0.[CardCode] as 'Cust ID', T0.[Phone1] as Phone, T0.[CntctPrsn] as 'Contact Person', T0.[Address], T0.[City], T0.[State1] as State, T0.[ZipCode] as 'Zip Code', T0.[Country],  T1.[TotalSales]
    FROM OCRD T0 
    INNER JOIN
       (SELECT I.[CardCode] AS CardCode, SUM(I.[DocTotal]) AS TotalSales
        FROM OINV I
        WHERE left (I.[CardCode], 3) = @rep AND (I.[DocDate] >= @startDate AND I.[DocDate] <= @endDate)
        GROUP BY I.[CardCode]) T1
    ON T0.[CardCode] = T1.[CardCode]
    ORDER BY T0.[CardName]
    FOR BROWSE

  • Prompt for user name and password when opening an application like Internet Explorer

    Hi
    I often use Internet Explorer using "Run as different user".  This is achieved by holding 'Shift' and right clicking the IE icon.  This is the main reason why I use IE as my default browser is Chrome.  Signing in as a different user
    is helpful when troubleshooting/customising certain applications such as Dynamics CRM.
    Is there away to force IE to always ask for credentials when I open it?  
    Marc Collins www.QGate.co.uk

    Hi GTS-NJ
    This was my first thought.  The problem I found is it requires a particular user.  I need to be flexible with the users I sign in with.
    I may have the answer though.  I have changed the security settings for trusted sites to always prompt for username and password.  I have added my sites to trusted sites.  Now when I browse to the site, it prompts me to sign in.
    Marc Collins www.QGate.co.uk

  • Prompt for user id and password during transfer of BI content for install

    Hi! I am trying to install the BI content for SRM. When I select the appropriate data source and transfer, the system will start the transfer and half way through will prompt me to enter the user id and password to the ECC backend system. It will continue the process once I keyed in the id and password. I also get a prompt to logon with user so that the system can check whether I am authorized in BW to transfer datasources into the source system from from the content. I usually reply OK and will have to key in the user id and password again. This time, it will be to the SRM system.
    Any idea whether this is normal or is there something missing in the set up? I have checked the RFC connection and it can connect when I tested the connection via SM59. The ports are also working.
    Appreciate any help on the above.
    Cheers!
    SF

    Hello,
    It is normal only..whenever you try to install Business content which involves the Transfer rules or datasource replicata then it will go to the source system and checks whether active version of Datasource is available or not..
    Fiirst activate the datasource in Source system and then install the flow in BI/BW.
    Hope it helps you..
    Regards,
    Srikanth

  • Office Documents prompting for user name and password

    Hi,
    We are using SharePoint 2010 and office documents are prompting for username and password when opened from SharePoint. we tried automatic logon setting in internet explorer and set the domain in trusted list
    of sites but nothing solves the problem. Anyone please provide a solution.
    Thanks,
    techie

    Hi Sharath,
    I have the user id in backend system , it is not locked nor expired.
    When I checked the certificate through STRUSTSSO2 validity is showing till 2027.
    How I can make sure that there is not an issie with certificates???
    Do we need to check something at protal side also?
    What all are the steps required for the checking the certificates at backend & portal side.
    There is no RFC defined from backend system to portal system in SM59 , I suppose we are using Bapi's for the same.
    Do we need to perform some check in Visual Admin also like checking the JCO connections???
    Regards,
    Prashant

  • WLAN network always prompts for user name and password...

    Hi,
    Everytime Airport detects the WLAN of my institution, it prompts "Authenticating to network" and I have to put in my user name and password. Is there any way to store this information (probably in the keychain) so that an automatic login to the WLAN [as in my home network] is possible? The problem is that I can not find any button like "save this password in the keychain" [you can only put in user name and password]. Is it possible that my institution prevents automatic login?
    I also tried to create an item in the keychain directly - does not work.
    Cheers

    Hi,
    I agree in that there has to be a prompt for WLAN access. Otherwise just everyone could step by and use the access. But if I have to authenticate once, why should the institution prevent an automatic login for me in the future? Well, okay, if someone steals my notebook and knows my master password... hmm, so there is no way to locally (on my notebook) use some software that automatically puts in my user name and password so that I - maybe - only have to push the "Go/Enter/Access" button?
    For example, some institutions use browsers to authenticate and 1Password, but also Safari natively, can automatically fill in the information.
    Cheers

  • Prompt for user inputs

    Hi,
    1) Want to prompt user for username & password
    2) connect to oracle
    3) want to use substring function on username entered by user
    3) user of substring output in procedure
    Performed as shown below but not working,
    PROMPT Enter username and password.
    PROMPT
    user:=&username;
    pass:=&passowrd;
    tns:=&tnsname;
    conn user/pass@tns
    PROMPT
    PROMPT
    set serveroutput on
    DECLARE
    variable1;
    variable2;
    varibale3;
    var:=substring(user,1,4);
    BEGIN
    var.package_name.procedure_name(cur);
    FETCH cur INTO variable1,variable2,varibale3;
    dbms_output.put_line('XYZ');
    END;
    Edited by: user640001 on Feb 28, 2012 11:27 PM

    trying to run as below but getting error for 'var'
    DECLARE
    var varchar2(20):=substr('&un',1,4);
    variable1 varchar2(20);
    cur var.package_name.Cursor;
    BEGIN
    var.package_name.procedure_name(cur);
    FETCH cur INTO variable1;
    dbms_output.put_line(variable1);
    END;
    cur var.package_name.Cursor;
    ERROR at line 16:
    ORA-06550: line 16, column 7:
    PLS-00487: Invalid reference to variable 'VAR'
    ORA-06550: line 16, column 7:

  • Prompt for user profile photos

    Hi,
      When we try to open any page in SharePoint with intranet users' pics in it, sometimes it prompts for user name and password and that to many times not once. So if I provide the username and password then it allows me to see the profile pics in the
    page otherwise shows a "x" on the picture.
    I want to know why this happens for some pics only not all?

    Hi ,
    What do you mean intranet users' pics?
    Does your MySite Host site have different FQDN from your SharePoint site?
    Please check if adding MySite url in IE browser trusted sites zone could work.
    If it still doesn't work, please check ULS log see if there is any related error for any clue when access the SharePoint page containing intranet users pics.
    Thanks
    Daniel Yang
    TechNet Community Support

Maybe you are looking for

  • How do we have 2 Apple ID on one iMac

    2 of us us one iMac How do we set up 2 iCloud accts

  • HT201250 Continuing backups with a time capsule or other network cloud storage device

    For over a year I used an external drive for my time machine backups. I purchased an external cloud (WD MyCloud) and yesterday I started to do a backup with it. I read a post which stated that if you keep your external drive plugged in and then chose

  • Does not fit the screen anymore

    everything seems shifted to the right of the screen

  • View Object with User Defined Type input

    I am trying to use a View Object with a query that requires a user defined object as an input parameter. I have the query working with a PreparedStatement, but would like to use a View Object. When I use the PreparedStatement, I prepare the user defi

  • Maximize my Network

    Hey Everyone. I would like some advice from someone on how to maximize my network. I have Verizon Fios. I have there Modem/Wireless Router. As well as a time capsule and a airport express. I have the time capsule set to be its own wireless network co