{"id":1902,"date":"2021-10-26T18:02:12","date_gmt":"2021-10-26T18:02:12","guid":{"rendered":"https:\/\/lgildv5i97.onrocket.site\/answers\/?post_type=question&#038;p=1902"},"modified":"2021-10-26T18:06:58","modified_gmt":"2021-10-26T18:06:58","slug":"shell-script-to-execute-sybase-system-procedures","status":"publish","type":"question","link":"https:\/\/computing.net\/answers\/unix\/shell-script-to-execute-sybase-system-procedures\/9123.html","title":{"rendered":"Shell Script To Execute Sybase System Procedures"},"content":{"rendered":"<p>I&#8217;m writing a shell script using Bourne shell (sh) to connect to sybase and execute some system procedures based on the data given by the user.<\/p>\n<p>However, i want my script to first check if the login id specified by the user exists before i start executing other system procedures to edit or remove some of the user&#8217;s details.<\/p>\n<p>I want my script to do the following, after connecting to sybase.<\/p>\n<p>1. Execute a system procedure &#8220;sp_displaylogin&#8221; to check if the user&#8217;s login exists.<br \/>\nIf it exists, then i have to redirect it to a function that performs the rest of the execution.<\/p>\n<p>2. If the login does not exist, then i have to execute a system procedure &#8220;sp_addlogin&#8221; to create the login.<\/p>\n<p>&nbsp;<\/p>\n<p>Now comes the big problem.<\/p>\n<p>I want to know how i can read the results of &#8220;sp_displaylogin&#8221; so that i can determine if the login id exists or not, and redirect my execution acordingly.<\/p>\n<p>How do i do it?<\/p>\n<p>Please help.<\/p>\n","protected":false},"author":5,"featured_media":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"inline_featured_image":false,"iawp_total_views":7},"question-category":[64],"question_tags":[],"class_list":["post-1902","question","type-question","status-publish","hentry","question-category-unix"],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/computing.net\/answers\/wp-json\/wp\/v2\/question\/1902","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/computing.net\/answers\/wp-json\/wp\/v2\/question"}],"about":[{"href":"https:\/\/computing.net\/answers\/wp-json\/wp\/v2\/types\/question"}],"author":[{"embeddable":true,"href":"https:\/\/computing.net\/answers\/wp-json\/wp\/v2\/users\/5"}],"replies":[{"embeddable":true,"href":"https:\/\/computing.net\/answers\/wp-json\/wp\/v2\/comments?post=1902"}],"wp:attachment":[{"href":"https:\/\/computing.net\/answers\/wp-json\/wp\/v2\/media?parent=1902"}],"wp:term":[{"taxonomy":"question-category","embeddable":true,"href":"https:\/\/computing.net\/answers\/wp-json\/wp\/v2\/question-category?post=1902"},{"taxonomy":"question_tags","embeddable":true,"href":"https:\/\/computing.net\/answers\/wp-json\/wp\/v2\/question_tags?post=1902"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}