According to TIBCO support there is no command to clear the command
line buffer:
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.
But David Lorenz suggests this way to use gui controls to prompt
for a user password while keeping it hidden on screen. This works in versions
7.0, 8.1, and 8.1.1, but not in 8.0 due to a bug in editfield.control.
getPW
<- function(Prompt = "Enter Password", title = "") {
## return the text
entered
Control <- list()
Control[[1]] <-
editfield.control(label = Prompt, value = "", size = c(200, 10),
password=T)
Dbox <- dialogbox(title,
controls = Control, buttons = "OK")
retval <-
dialogbox.display(Dbox)$values[[Prompt]]
return(retval)
}
Example using David's getPW function to retrieve data from a
database without exposing the password:
> # user and server are faked in this example
> mynewdata <- importData(
+ type="direct-oracle",
+ user="MYUSERNAME",
+ password=getPW(),
+ server="BIGDATABASE",
+ sqlQuery = "SELECT 'foo' AS foo_bar FROM
dual"
+ )
# password entered at gui prompt is masked as
asterisks
> mynewdata
FOO.BAR
1 foo
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
Douglas Hersh
Environmental Quality Department
Massachusetts Water
Resource Authority
100 First Ave. Boston MA 02129
email: douglas daht hersh
ayaht mwra.state.ma.us
http://www.mwra.state.ma.us/harbor/html/bhrecov.htm