{"id":741,"date":"2022-08-30T15:06:24","date_gmt":"2022-08-30T15:06:24","guid":{"rendered":"https:\/\/unknownerror.org\/index.php\/2013\/11\/09\/problem-about-shell-script-collection-of-common-programming-errors\/"},"modified":"2022-08-30T15:06:24","modified_gmt":"2022-08-30T15:06:24","slug":"problem-about-shell-script-collection-of-common-programming-errors","status":"publish","type":"post","link":"https:\/\/unknownerror.org\/index.php\/2022\/08\/30\/problem-about-shell-script-collection-of-common-programming-errors\/","title":{"rendered":"problem about shell-script-Collection of common programming errors"},"content":{"rendered":"<ul>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/815ee86e14bbedd4f353cad0680c7be5?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nMat<br \/>\nshell shell-script sed<br \/>\nFor my script I have to read the data from a file. For example I have 2 files: one is a text file, the second is a csv file with 10 columns.What I am trying to do is to read the csv and change the parameters in the first file.Using sed -n to read the data one row at a time and save this in a fileC Using sed &#8220;s\/&amp;replacefile1param\/&amp;readFileC\/<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/f5616409d67b8c1b0b661201210b8ef1?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\njasonwryan<br \/>\nshell shell-script trap<br \/>\nI wrote a shell script run_script.sh, which includes a step which creates an empty file run_script.lck. Everytime the shell script was called by the cronjob, it will check for the existence of run_script.lck. If the lock is presence, it indicates that run_script.sh is already runn<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/85af3cb1fb8076180db3ab964c9699ed?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nMikel<br \/>\nbash shell shell-script solaris<br \/>\nI have a script similar following one:#!\/usr\/bin\/shvar=&#8221;ABC&#8221; if [ $var == &#8220;ABC&#8221; ] thenecho True elseecho False fiAbove code does not work in Solaris Sparc and Solaris X6<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/da5e11d3f25a58742129931a5da9e3d7?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nRobert<br \/>\nbash ssh shell-script kvm<br \/>\nI&#8217;m trying to run a set of commands on a remote machine, that includes an if statement. I&#8217;m using this to shutdown a list of kvm instances. The first line should be fine, but could be prettier, rest needs some help. ssh root@kvmsrv &#8216;virsh shutdown $host 2&gt; \/de<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/9d96093408df0463815ff4d9b8a0c1a9?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nslhck<br \/>\nwindows linux bash shell-script text-editing<br \/>\nI&#8217;ve this plain text file that I need to be automatically examined and results written in another plain text file. Note that I&#8217;ll use plain text and CSV interchangeably, since CSVs are plain text with common separator between data (commas, tabs, etc).Dat<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/ed3d7e961b7516b0dbc5a80553e89bec?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nsnihalani<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/7064369714bbb01ca2e42c699f95d60d?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nshantanuo<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/a12e278ca2b7e9cd4807a104f8719e26?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nangus<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/a12e278ca2b7e9cd4807a104f8719e26?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nangus<br \/>\nbash shell-script getopts<br \/>\nWhen parsing command line arguments with<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/513069195a0fe87b2fb64979bc6c349e?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nMoorage<br \/>\nlinux shell-script centos-5<br \/>\nI am getting the databases from mysql and my database name is username_something. I am getting the username an<\/li>\n<\/ul>\n<p id=\"rop\"><small>Originally posted 2013-11-09 22:11:03. <\/small><\/p>","protected":false},"excerpt":{"rendered":"<p>Mat shell shell-script sed For my script I have to read the data from a file. For example I have 2 files: one is a text file, the second is a csv file with 10 columns.What I am trying to do is to read the csv and change the parameters in the first file.Using sed [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-741","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/741","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/comments?post=741"}],"version-history":[{"count":0,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/741\/revisions"}],"wp:attachment":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/media?parent=741"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/categories?post=741"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/tags?post=741"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}