I Have to suppress result set from a stored proc Is there any set command to suppress the result set in sybase stored proc?
I have a stored proc,i want to use that in my front end and script with out duplicating
Thanks
Try fmtonly option.
set fmtonly on
go
exec stored_proc(...)
go
Related
When in insert mode in vim, I often do CTRL-R and retrieve a register content.
I like to be able to retrieve text that's not currently in a buffer, like the output of the shell command, pwd.
I was under the impression I could hit i_CTRL_R ! pwd sequence, but i_CTRL_R can only takes a register.
The expression register = seems to be the only way to compute things dynamically, but I don't know what is the minimum number of key-strokes to get the = register to be populated with a shell output, or env variables.
Vimmers?
You can insert environment variables directly with:
<C-r>=$PATH
For inserting the output of shell commands you will need :help system() if you absolutely need to stay in insert mode:
<C-r>=system('ls')
If you don't mind leaving insert mode temporarily, you can use :help :read:
<C-o>:r!ls<CR>
I like to split a window(about 10 lines, top of the screen) when I'm writing something, in order to reference some other files easily.
I want to save the windows layout(just the splitting layout without the editing files), so that I can start working quickly.
I tried to put
set sessionoptions-=blank
set sessionoptions-=tabpages
set sessionoptions-=winsize
in .vimrc and then
:mksession file.vim
but when I try to vim -S file.vim, I can't see the layout but a new windows, why?
Thank you
Try this:
:set sessionoptions=blank,winsize,tabpages,resize
When you do -=, you are removing those options from sessionoptions. I assume you probably want to use += instead. By default, sessionoptions is set to buffers,winsize,options,help,blank. By using =, you are getting rid of all the options you don't want.
In a script, I have the following not working code:
set eval(rules[formatoption])=value
where rules is a dictionary and formatoption and value are a variable. I want to make Vim read the variable name from rules[formatoption] and set it to value. How can I make Vim set a variable this way? I think there should be a function like setvar(name, value)or something similar, that sets name(string) to value. That line of code would save me from writing about 30 lines of code in a 70 lines script.
Use :execute:
execute 'set' rules[formatoption] . '=value'
You can also change Vim options via :let &optionname = ..., but that doesn't help here. There's also the obscure :help curly-braces-names, but that won't work here, neither.
I'd like to try out different regexes for the formatlistpat option. Any suggestions as to the easiest way to do this?
I know in Insert mode I can use <Ctrl+r> to paste in a register. And that I can use this do edit macros. Is there an equivalent for options? Or something even simpler?
The other idea I had was just sourcing a buffer with the set command in it. But I'm unsure of the way to put an option value into buffer so it can be edited.
Any thoughts? Tips? Suggestions?
When you are editing command-line you have two options here:
Use autocomplete:
set formatlistpat=<Tab>
(not really tab, but rather whatever 'wildchar'/'wildcharm' is set to). This will populate command-line with current option value, properly escaped. I cannot suggest this way for this particular option because double escaping looks ugly and there are lots of escapes in most patterns.
Use expression register (works both in command-line and in insert mode):
let &formatlistpat=<C-r>=string(&formatlistpat)<CR>
Note that in this case escaping is not done automatically. Using :let and string() is easier then do proper escaping for :set.
Based on ZyX's answer, the following is effective for a .vimrc file:
let &formatlistpat="^\s*\d\+[\]:.)}\t ]\s*\|^\s*[-*]\s+"
let &formatlistpat=string(&formatlistpat)
I'm extracting a part of a web application that handles the signup, the other part will be rewritten.
The idea is the signup part can exist as a separate application, interface with the rest of the application for creating and setting up the account. Obviously there are a ton of ways to do this, most of them network based solutions like SOAP, but I'd like to use a simpler solution: a setup script.
The concern is that certain sensitive data, specifically the admin password of the new account, would be passed through bash.
I was thinking of sharing a small class between the applications, so that the password can be passed already hashed, but I would also have to pass the salt, so it still seems like a (small) security risk. One of the concerns is bash logging (can I disable that for a single command?) but I'm sure there are other concerns as well?
This would be on the same private server, so the risk seems minimal, but I don't want to take any chances whatsoever.
Thanks.
Use the $HISTFILE environment variable, unset it (this is for all users):
echo "unset HISTFILE" >> /etc/profile
Then set it back again.
More info on $HISTFILE variable here: http://linux.about.com/cs/linux101/g/histfileenviron.htm
Hope this helps!
From the man page of bash:
HISTIGNORE
A colon-separated list of patterns used to decide which
command
lines should be saved on the history list. Each pattern
is
anchored at the beginning of the line and must match
the com-
plete line (no implicit ‘*’ is appended). Each pattern
is
tested against the line after the checks specified by
HISTCONTROL are applied. In addition to the normal shell
pattern
matching characters, ‘&’ matches the previous history line.
‘&’
may be escaped using a backslash; the backslash is
removed
before attempting a match. The second and subsequent
lines of a
multi-line compound command are not tested, and are added
to the
history regardless of the value of HISTIGNORE.
Or, based on your comment, you could store the password in a protected file, then read from it.
Passing the salt in clear is no problem (the salt is usually stored in clear), the purpose of the salt is avoiding the same password hashing to the same hash always (so users with the same password would have the same hash, and rainbow tables would only need a single hash for each possible password).
What is more problematic is passing sensitive data through command line arguments, an eavesdropper on the same box can see the arguments to any command (on Linux they appear on /proc//cmdline, and on most Unixes can be seen using ps; some systems restrict permissions on /proc// to only the owner of the process for security).
What you could do is pass the sensitive information through a file, don't forget to set the umask to a very restrictive setting before creating the file.
Bash doesn't normally log commands executed in scripts, but only in interactive sessions (depending on appropriate settings). To show this, use the following script:
#!/bin/bash
echo "-- shopt --"
shopt | grep -i hist
echo "-- set --"
set -o | grep -i hist
echo "--vars --"
for v in ${!HIST*}
do
echo "$v=${!v}"
done
Run it like this:
$ ./histshow
and compare the output to that from sourcing it like this:
$ . ./histshow
In the first case take note that HISTFILE is not set and that the set option history is off. In the second case, sourcing the script runs it in your interactive session and shows what your settings are for it.
I was only able to make a script keep an in-memory history by doing set -o history within the script and to log its history to a file by also setting HISTFILE and then doing an explicit history -w.