{\ttfamily kdb sget $<$key name$>$ $<$default-\/value$>$}

Where {\ttfamily key name} is the name of the key to retrieve and {\ttfamily default-\/value} is the value that should be printed if no value can be retrieved.

\subsection*{D\+E\+S\+C\+R\+I\+P\+T\+I\+ON}

This command is used to retrieve the value of a key from within a script. When using the kdb tool in a script, the user should use the {\ttfamily sget} command in place of the kdb-\/get(1) command. The kdb-\/get(1) command should not be used in scripts because it may return an error instead of printing a value in certain circumstances. The {\ttfamily sget} command guarantees that a value will be printed (unless the user passes faulty arguments). This command will either print the value of the key it retrieves or a default value that the user specifies.

\subsection*{O\+P\+T\+I\+O\+NS}


\begin{DoxyItemize}
\item {\ttfamily -\/H}, {\ttfamily -\/-\/help}\+: Show the man page.
\item {\ttfamily -\/V}, {\ttfamily -\/-\/version}\+: Print version info.
\item {\ttfamily -\/p}, {\ttfamily -\/-\/profile $<$profile$>$}\+: Use a different kdb profile.
\item {\ttfamily -\/C}, {\ttfamily -\/-\/color $<$when$>$}\+: Print never/auto(default)/always colored output.
\end{DoxyItemize}

\subsection*{E\+X\+A\+M\+P\+L\+ES}

To get the value of a key from a script or return the value {\ttfamily 0}\+:~\newline
 {\ttfamily kdb sget user/example/key 0}

To get the value of a key using a cascading lookup or return the value {\ttfamily notfound}\+:~\newline
 {\ttfamily kdb sget /example/key \char`\"{}notfound\char`\"{}}

\subsection*{S\+EE A\+L\+SO}


\begin{DoxyItemize}
\item \hyperlink{md_doc_help_kdb-get_doc_help_kdb-get_md}{kdb-\/get(1)}
\item \hyperlink{md_doc_help_elektra-key-names_doc_help_elektra-key-names_md}{elektra-\/key-\/names(7)} for an explanation of key names. 
\end{DoxyItemize}