{"id":6878,"date":"2019-10-07T08:54:04","date_gmt":"2019-10-07T08:54:04","guid":{"rendered":"https:\/\/www.devopsschool.com\/blog\/?p=6878"},"modified":"2022-12-22T14:36:17","modified_gmt":"2022-12-22T14:36:17","slug":"shell-bash-scripting-interview-questions-and-answer-part-3","status":"publish","type":"post","link":"https:\/\/www.devopsschool.com\/blog\/shell-bash-scripting-interview-questions-and-answer-part-3\/","title":{"rendered":"Shell Bash Scripting Interview Questions and Answer \u2013 Part 3"},"content":{"rendered":"\n<ol class=\"wp-block-list\">\n<li>How can I print shell script name?<\/li>\n\n\n\n<li> How to write a script when the first command is executed then execute the below script?<\/li>\n\n\n\n<li> Can you tell me the syntax for for loop and while loop?<\/li>\n\n\n\n<li> How to print shell name?<\/li>\n\n\n\n<li> How to assign a all the arguments to a single variable?<\/li>\n\n\n\n<li> How to print the current processid of current shell?<\/li>\n\n\n\n<li> How to know the file that is entering randomly to my script?<\/li>\n\n\n\n<li> How to divide two variables in shell script?<\/li>\n\n\n\n<li> What is trap?<\/li>\n\n\n\n<li> What is shift in shell script?<\/li>\n\n\n\n<li> How to run our script in background?<\/li>\n\n\n\n<li> How to know the running back ground process id ?<\/li>\n\n\n\n<li> What is $*, $$ and $@?<\/li>\n\n\n\n<li> How to print only directories?<\/li>\n\n\n\n<li> How to print the directory only started with number?<\/li>\n\n\n\n<li> How to grep two strings at a time?<\/li>\n\n\n\n<li> How to grep a string that is started with some string and ends with some string like a\u2026..b ?<\/li>\n\n\n\n<li> How to print string that starts with a?<\/li>\n\n\n\n<li> Did you worked on arrays?<\/li>\n\n\n\n<li> How will you give access of your script to a particular user?<\/li>\n\n\n\n<li> How to access background running scripts and their pid?<\/li>\n\n\n\n<li> How to run our script in foreground?<\/li>\n<\/ol>\n","protected":false},"excerpt":{"rendered":"","protected":false},"author":1,"featured_media":8341,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_joinchat":[],"footnotes":""},"categories":[454],"tags":[],"class_list":["post-6878","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-shell-script"],"_links":{"self":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/6878","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/comments?post=6878"}],"version-history":[{"count":2,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/6878\/revisions"}],"predecessor-version":[{"id":32353,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/6878\/revisions\/32353"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/media\/8341"}],"wp:attachment":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/media?parent=6878"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/categories?post=6878"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/tags?post=6878"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}