s-news
[Top] [All Lists]

Re: Is there a command to clear the command line buffer

To: "Hersh, Douglas" <Douglas.Hersh@mwra.state.ma.us>
Subject: Re: Is there a command to clear the command line buffer
From: David L Lorenz <lorenz@usgs.gov>
Date: Fri, 1 May 2009 08:12:35 -0500
Cc: s-news@lists.biostat.wustl.edu, s-news-owner@lists.biostat.wustl.edu
In-reply-to: <C0CF5802DA312049982061E94F592D390B6AFD62@MWRAMAIL.mwra.net>
References: <C0CF5802DA312049982061E94F592D390B6AFD5C@MWRAMAIL.mwra.net> <C0CF5802DA312049982061E94F592D390B6AFD62@MWRAMAIL.mwra.net>

Douglas,
  You might consider using a pop-up window instead of using the Commands Window to read the password. Here's a short piece of code that should get you close:
getText <- function(Prompt = "Enter text", title = "") {
        ## return the text entered
        Control <- list()
        Control[[1]] <- editfield.control(label = Prompt, value = "", size = c(200, 10))
        Dbox <- dialogbox(title, controls = Control, buttons = "OK")
        retval <- dialogbox.display(Dbox)$values[[Prompt]]
        return(retval)
}

Just substitute the call to getText for readline.
Dave


From: "Hersh, Douglas" <Douglas.Hersh@mwra.state.ma.us>
To: <s-news@lists.biostat.wustl.edu>
Date: 04/30/2009 09:31 AM
Subject: Re: [S] Is there a command to clear the command line buffer
Sent by: s-news-owner@lists.biostat.wustl.edu





Control over commands history can only be controlled on a session-by-session basis by setting the S_CMDSAVE environment variable when starting splus.exe.
 
Kirsten Smith                        
Technical Support Engineer              
TIBCO Spotfire Corporation replied:

 
Currently the only way to clear the Commands History is to close out of Spotfire S+, which I suspect you already knew.  There is a way, however, to prevent any of the commands to be stored to history.  There is an environment variable called 'S_CMDSAVE' that you can to any number which limits the number of commands saved to history.

To set this, close out of S+ and right click on your shortcut icon and click on 'Properties'.  In the Target field under the Shortcut tab add a space at the end of the string that is already there and add S_CMDSAVE=0.  It should look something like this:

"D:\Program Files\TIBCO\splus81\cmd\SPLUS.exe" S_CMDSAVE=0

Restart S+ and you should see that none of your commands are saved to history.

 



From: Hersh, Douglas
Sent:
Tuesday, April 28, 2009 4:38 PM
To:
s-news@lists.biostat.wustl.edu
Subject:
Is there a command to clear the command line buffer

 
It must be possible to clear the command line buffer using a command at the command prompt or from a script, but I can not find it in the documentation.
 
I have a need for users to run a script that logs into a database to retrieve data into a dataframe, but I need some way to keep the password from persisting on screen or in a file for security reasons.
 
I doubt that there is any way to hide the input to readline() as it is typed at the command line, but it would make things more secure if I could clear the screen buffer right after importData has finished.
 
# test.ssc
mynewdata <- importData(
type="direct-oracle",
user="DB_USER",
password=readline(prompt="Enter password at prompt in command window: "),
server="BIGDATABASE",
sqlQuery = "SELECT 'foo' AS foo_bar FROM dual"
)
 
This came up 9-years ago on this list, but it has not been answered. I opened a service request with Tibco for this. I will post their response if I get one.
 
Thanks very much.
 
- Doug

<Prev in Thread] Current Thread [Next in Thread>
  • Re: Is there a command to clear the command line buffer, David L Lorenz <=