{"id":443,"date":"2021-07-31T00:31:21","date_gmt":"2021-07-30T19:01:21","guid":{"rendered":"https:\/\/blog.al-zakirah202.familyds.com\/?p=443"},"modified":"2021-07-31T00:31:21","modified_gmt":"2021-07-30T19:01:21","slug":"perl-like-getopt-functionality-for-shell-scripting","status":"publish","type":"post","link":"https:\/\/blog.al-zakirah202.familyds.com\/wordpress\/2021\/07\/31\/perl-like-getopt-functionality-for-shell-scripting\/","title":{"rendered":"Perl like GetOpt functionality for Shell Scripting"},"content":{"rendered":"\r\n<p>One of the powerful features of the terminal app which&#8217;s available by default on Linux &amp; Mac OS is the unix shells it supports. \u00a0It offers plethora of unix commands which can be bunched together in a file (called &#8216;the script&#8217;) to run as a group. <!--more-->You would use the script for example in-order to accomplish a task automatically and obviously this is one of the key features which everyone admires. \u00a0Ever wondered how to output a professional looking help when someone runs your script? \u00a0Something that&#8217;s available &amp; supported in most of the GNU unix commands like sed?<\/p>\r\n<div id=\"attachment_452\" style=\"width: 810px\" class=\"wp-caption aligncenter\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-452\" src=\"https:\/\/blog.al-zakirah202.familyds.com\/wp-content\/uploads\/2021\/07\/Screenshot-2021-07-30-at-11.31.07-PM-1024x284.png\" alt=\"\" width=\"800\" height=\"222\" class=\"size-large wp-image-452\" srcset=\"https:\/\/blog.al-zakirah202.familyds.com\/wordpress\/wp-content\/uploads\/2021\/07\/Screenshot-2021-07-30-at-11.31.07-PM-1024x284.png 1024w, https:\/\/blog.al-zakirah202.familyds.com\/wordpress\/wp-content\/uploads\/2021\/07\/Screenshot-2021-07-30-at-11.31.07-PM-300x83.png 300w, https:\/\/blog.al-zakirah202.familyds.com\/wordpress\/wp-content\/uploads\/2021\/07\/Screenshot-2021-07-30-at-11.31.07-PM-768x213.png 768w, https:\/\/blog.al-zakirah202.familyds.com\/wordpress\/wp-content\/uploads\/2021\/07\/Screenshot-2021-07-30-at-11.31.07-PM-1536x426.png 1536w, https:\/\/blog.al-zakirah202.familyds.com\/wordpress\/wp-content\/uploads\/2021\/07\/Screenshot-2021-07-30-at-11.31.07-PM-2048x568.png 2048w\" sizes=\"auto, (max-width: 800px) 100vw, 800px\" \/><p id=\"caption-attachment-452\" class=\"wp-caption-text\">Output of &#8220;sed &#8211;help&#8221; on a terminal<\/p><\/div>\r\n<p>A good script would handle the arguments &amp; options provided to it in an efficient way and outputs clear help\/usage information. \u00a0One of the commands which the unix shells support is &#8220;GetOpt&#8221; which&#8217;s a in-built command, which can be used to parse arguments &amp; options provided to it. \u00a0However, it&#8217;s not as user-friendly and feature rich as GetOpts function supported by programming languages like Perl, which can not only parse the options &amp; arguments but also can store the values of some of those options in variables with intuitive names. \u00a0<\/p>\r\n<p>As an example, let&#8217;s say you are developing a bash shell-script <em><strong>&#8216;sample.sh&#8217;<\/strong><\/em> which you want it to support 3 options:<\/p>\r\n<ul>\r\n<li>&#8211;help or -h: For displaying the help message<\/li>\r\n<li>&#8211;version or -v: For displaying the version information<\/li>\r\n<li>&#8211;file or -f: For taking the file name as one of the arguments\u00a0<\/li>\r\n<\/ul>\r\n<p>Ever wondered, how easy it would be, if I can get a template which can:<\/p>\r\n<ul>\r\n<li>Set the variable &#8220;opt_help&#8221; if either the long option &#8220;&#8211;help&#8221; or short option &#8220;-h&#8221; is given to the script<\/li>\r\n<li>Set the variable &#8220;opt_version&#8221; if either the long option &#8220;&#8211;version&#8221; or short option &#8220;-v&#8221; is given to the script<\/li>\r\n<li>Set the variable &#8220;opt_file&#8221; to have the file name as the value stored in it<\/li>\r\n<li>Give error message if the user uses the &#8220;&#8211;file&#8221; or &#8220;-f&#8221; option without an associated file name as the argument<\/li>\r\n<li>Give error message if any other option other than the 3 listed above are used<\/li>\r\n<\/ul>\r\n<p>It would make the life of scripting so easy and take away the burden of handling all of these so that you can stay focussed on programming the main task. \u00a0This is what I have tried to accomplish in the template file below. \u00a0The <em><strong>&#8216;main&#8217;\u00a0<\/strong><\/em>function is the one you would use to code the main tasks while the other functions implement what I talked above. \u00a0You might want to modify the <strong><em>&#8216;Help&#8217;\u00a0<\/em><\/strong>function to output the appropriate usage information. \u00a0You might also want to edit the <em><strong>&#8216;GetOpts&#8217;<\/strong><\/em>\u00a0call on line #191 below to include additional options in the format <em><strong>&#8216;f|file:\\&#8217;\u00a0<\/strong><\/em>at line #194 and so on. \u00a0The colon &#8216;:&#8217; after the name of the long option tells the <em><strong>&#8216;GetOpts&#8217; <\/strong><\/em>function that this particular option needs an argument.<\/p>\r\n<h3>Linux:<\/h3>\r\n<p>On Linux OS, the template should work as is without any issues. \u00a0As the GNU command line toolset which ships with the Linux is one of the best with lots of features.<\/p>\r\n<h3>Mac OS:<\/h3>\r\n<p>On Mac, you need to get the following installed before you could run this template<\/p>\r\n<ul>\r\n<li>First install the Homebrew command. \u00a0There are plenty of blog posts available on the internet to guide you on how to install home-brew package on Mac<\/li>\r\n<li>Once home brew is installed then you need to execute the following commands:\r\n<ul>\r\n<li><span style=\"font-family: Consolas, Monaco, monospace;\">brew install gnu-getopt<\/span><\/li>\r\n<li><span style=\"font-family: Consolas, Monaco, monospace;\">brew install gnu-sed<\/span><\/li>\r\n<li><span style=\"font-family: Consolas, Monaco, monospace;\">brew install grep<\/span><\/li>\r\n<\/ul>\r\n<\/li>\r\n<li>The above 3 commands would install the GNU version of\u00a0<i>getopt, sed &amp; grep\u00a0<\/i>commands which are needed for this template to work properly<\/li>\r\n<li>Lastly, you need to edit your .cshrc file (see <a href=\"https:\/\/blog.al-zakirah202.familyds.com\/index.php\/2021\/07\/24\/the-cshrc-file-in-a-tcsh-shell\/\">here<\/a> for the blog on cshrc file) to edit the PATH variable as shown below\r\n<ul>\r\n<li>\u00a0<span style=\"font-family: Consolas, Monaco, monospace;\">setenv <span>PATH \/usr\/local\/opt\/grep\/libexec\/gnubin:\/usr\/local\/opt\/gnu-sed\/libexec\/gnubin:\/usr\/local\/opt\/gnu-getopt\/bin:${PATH}<\/span><\/span><\/li>\r\n<\/ul>\r\n<\/li>\r\n<li>Now you should be all set to use this template on a Mac<\/li>\r\n<\/ul>\r\n<h3>Outputs:<\/h3>\r\n<p>I have named this template as sample.sh to run it on the shell.<\/p>\r\n<div id=\"attachment_453\" style=\"width: 810px\" class=\"wp-caption aligncenter\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-453\" src=\"https:\/\/blog.al-zakirah202.familyds.com\/wp-content\/uploads\/2021\/07\/Screenshot-2021-07-31-at-12.13.31-AM-1024x646.png\" alt=\"\" width=\"800\" height=\"505\" class=\"size-large wp-image-453\" srcset=\"https:\/\/blog.al-zakirah202.familyds.com\/wordpress\/wp-content\/uploads\/2021\/07\/Screenshot-2021-07-31-at-12.13.31-AM-1024x646.png 1024w, https:\/\/blog.al-zakirah202.familyds.com\/wordpress\/wp-content\/uploads\/2021\/07\/Screenshot-2021-07-31-at-12.13.31-AM-300x189.png 300w, https:\/\/blog.al-zakirah202.familyds.com\/wordpress\/wp-content\/uploads\/2021\/07\/Screenshot-2021-07-31-at-12.13.31-AM-768x485.png 768w, https:\/\/blog.al-zakirah202.familyds.com\/wordpress\/wp-content\/uploads\/2021\/07\/Screenshot-2021-07-31-at-12.13.31-AM-1536x970.png 1536w, https:\/\/blog.al-zakirah202.familyds.com\/wordpress\/wp-content\/uploads\/2021\/07\/Screenshot-2021-07-31-at-12.13.31-AM-2048x1293.png 2048w\" sizes=\"auto, (max-width: 800px) 100vw, 800px\" \/><p id=\"caption-attachment-453\" class=\"wp-caption-text\">Output with &#8220;&#8211;help&#8221; or &#8220;-h&#8221; options<\/p><\/div>\r\n<div id=\"attachment_454\" style=\"width: 810px\" class=\"wp-caption aligncenter\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-454\" src=\"https:\/\/blog.al-zakirah202.familyds.com\/wp-content\/uploads\/2021\/07\/Screenshot-2021-07-31-at-12.14.45-AM-1024x304.png\" alt=\"\" width=\"800\" height=\"238\" class=\"size-large wp-image-454\" srcset=\"https:\/\/blog.al-zakirah202.familyds.com\/wordpress\/wp-content\/uploads\/2021\/07\/Screenshot-2021-07-31-at-12.14.45-AM-1024x304.png 1024w, https:\/\/blog.al-zakirah202.familyds.com\/wordpress\/wp-content\/uploads\/2021\/07\/Screenshot-2021-07-31-at-12.14.45-AM-300x89.png 300w, https:\/\/blog.al-zakirah202.familyds.com\/wordpress\/wp-content\/uploads\/2021\/07\/Screenshot-2021-07-31-at-12.14.45-AM-768x228.png 768w, https:\/\/blog.al-zakirah202.familyds.com\/wordpress\/wp-content\/uploads\/2021\/07\/Screenshot-2021-07-31-at-12.14.45-AM-1536x456.png 1536w, https:\/\/blog.al-zakirah202.familyds.com\/wordpress\/wp-content\/uploads\/2021\/07\/Screenshot-2021-07-31-at-12.14.45-AM-2048x608.png 2048w\" sizes=\"auto, (max-width: 800px) 100vw, 800px\" \/><p id=\"caption-attachment-454\" class=\"wp-caption-text\">Output with &#8220;&#8211;version&#8221; or &#8220;-v&#8221; option<\/p><\/div>\r\n<p>&nbsp;<\/p>\r\n<div id=\"attachment_455\" style=\"width: 810px\" class=\"wp-caption aligncenter\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-455\" src=\"https:\/\/blog.al-zakirah202.familyds.com\/wp-content\/uploads\/2021\/07\/Screenshot-2021-07-31-at-12.15.48-AM-1024x168.png\" alt=\"\" width=\"800\" height=\"131\" class=\"wp-image-455 size-large\" srcset=\"https:\/\/blog.al-zakirah202.familyds.com\/wordpress\/wp-content\/uploads\/2021\/07\/Screenshot-2021-07-31-at-12.15.48-AM-1024x168.png 1024w, https:\/\/blog.al-zakirah202.familyds.com\/wordpress\/wp-content\/uploads\/2021\/07\/Screenshot-2021-07-31-at-12.15.48-AM-300x49.png 300w, https:\/\/blog.al-zakirah202.familyds.com\/wordpress\/wp-content\/uploads\/2021\/07\/Screenshot-2021-07-31-at-12.15.48-AM-768x126.png 768w, https:\/\/blog.al-zakirah202.familyds.com\/wordpress\/wp-content\/uploads\/2021\/07\/Screenshot-2021-07-31-at-12.15.48-AM-1536x252.png 1536w, https:\/\/blog.al-zakirah202.familyds.com\/wordpress\/wp-content\/uploads\/2021\/07\/Screenshot-2021-07-31-at-12.15.48-AM-2048x336.png 2048w\" sizes=\"auto, (max-width: 800px) 100vw, 800px\" \/><p id=\"caption-attachment-455\" class=\"wp-caption-text\">Output when a wrong option (say &#8216;-a&#8217;) is given<\/p><\/div>\r\n<h3>sample.sh<\/h3>\r\n\r\n\r\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\n#!\/bin\/bash\r\n\r\n#************************************************************#\r\n## \t\t\t\t\t$_PGR.sh \t\t\t\t    \t         #\r\n## \t\t\t\twritten by Amjad khan\t\t\t             #\r\n##\t\t\tEmail: khan.amjadull@gmail.com\t\t             #\r\n##\t\t\tPhone: +91-9900497591\t\t\t\t \t         #\r\n##\t\t\t                                \t \t         #\r\n## #\r\n## #\r\n#************************************************************#\r\n\r\n##************ Define some functions ******##\r\n\r\n##----------------- Version? --------------##\r\n## Give the version information and exit   ##\r\n## Command line options -v or --version\t   ##\r\n## Exit status is 0\t\t\t\t\t\t   ##\r\n##-----------------------------------------##\r\nfunction version()\r\n{\r\n\tVER=$(echo &#039;$Revision$&#039; | sed -e &#039;s\/.*: \/\/; s\/ .*\/\/; s\/\\$Revision\\$\/0.0\/&#039;)\r\n\tYEAR=$(date +%Y)\r\n\t\r\n\tcat &lt;&lt;- ___VERSION_INFO___\r\n\t$MY_PRG ###utility### $VER\r\n\tWritten by Amjad khan\r\n\r\n\tCopyright (C) $YEAR - GRAPES PVT LTD\r\n\tAll rights reserved.\r\n\t___VERSION_INFO___\r\n\r\n\texit 0\r\n}\r\n\r\n\r\n##----------------- Help ----------------##\r\n## Give the help information and exit\t ##\r\n## Command line options -h or --help\t ##\r\n## Exit status is 0\t\t\t\t\t\t ##\r\n##---------------------------------------##\r\nfunction Help()\r\n {\r\n\tcat &lt;&lt;- ___HELP_MESSAGE___\r\n\tUsage: $MY_PRG &#x5B;OPTION]... &#x5B;FILE]...\r\n\r\n\r\n\tExamples: \r\n\t  $MY_PRG\t\t\t# Comments\r\n\r\n\t## ---&lt;description&gt;---\r\n\r\n\tMandatory arguments to long options are mandatory for short options too.\r\n\r\n\t## ---&lt;explanation for args&gt;---\r\n  \r\n  \r\n\t  -h, --help\tdisplay this help and exit\r\n\t  -v, --version\toutput version information and exit\r\n\r\n\t## ---&lt;extra info&gt;---\r\n\r\n\tReport bugs to &lt;khan.amjadull@gmail.com&gt;.\r\n\t___HELP_MESSAGE___\r\n\r\n\texit 0\r\n}\r\n\r\n\r\n##----------------- Cleanup ----------------##\r\n## Clean up temporary files\t\t\t\t\t##\r\n## Exit status is 0\t\t\t\t\t\t\t##\r\n##------------------------------------------##\r\nfunction cleanup_tmpfiles {\r\n\trm -rf $_TMP\r\n}\r\n\r\n\r\n\r\n##--------- Syntax error :( ---------##\r\n## Help to try Help\t\t\t\t\t ##\r\n##-----------------------------------##\r\nfunction try_help {\t\t# Direct the user to get some help\t\t\r\n\techo &quot;Try \\`$MY_PRG --help&#039; for more information&quot; &amp;&amp; exit 1\t\t\r\n}\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\r\n\r\n\r\n##---------------- Getopts ------------------##\r\n## Utility very similar to perl getopts      ##\r\n## Can handle long options and set variables ##\r\n##-------------------------------------------##\r\nfunction Getopts(){\r\n\r\n\tdeclare  shorts\r\n\tdeclare  longs\r\n\tdeclare  same\r\n\tdeclare -a args\r\n\tlocal index\r\n\r\n\tuntil &#x5B; &quot;$1&quot; = &quot;--&quot; ] ; do\r\n\r\n\t\tif echo $1 |grep -q -P &#039;^\\S\\|\\S+:$&#039;; then\r\n\t\t\tshorts=(${shorts&#x5B;@]} ${1%|*}:)\r\n\t\t\tlongs=(${longs&#x5B;@]} ${1#*|})\r\n\t\t\tsame=(${same&#x5B;@]} $1);\r\n\t\r\n\t\telif echo $1 |grep -q -P &#039;^\\S\\|\\S+$&#039;; then\r\n\t\t\tshorts=(${shorts&#x5B;@]} ${1%|*})\r\n\t\t\tlongs=(${longs&#x5B;@]} ${1#*|})\r\n\t\t\tsame=(${same&#x5B;@]} $1);\r\n\t\r\n\t\telif echo $1 |grep -q -P &#039;^\\S+\\|\\S:$&#039;; then\r\n\t\t\tlongs=(${longs&#x5B;@]} ${1%|*}:)\r\n\t\t\tshorts=(${shorts&#x5B;@]} ${1#*|})\r\n\t\t\tsame=(${same&#x5B;@]} $1);\r\n\t\r\n\t\telif echo $1 |grep -q -P &#039;^\\S+\\|\\S$&#039;; then\r\n\t\t\tlongs=(${longs&#x5B;@]} ${1%|*})\r\n\t\t\tshortss=(${shorts&#x5B;@]} ${1#*|})\r\n\t\t\tsame=(${same&#x5B;@]} $1);\r\n\r\n\t\telif echo $1 |grep -q -P &#039;^\\S:?$&#039;;then\r\n\t\t\tshorts=(${shorts&#x5B;@]} $1);\r\n\t\r\n\t\telif echo $1 |grep -q -P &#039;^\\S\\S+:?$&#039;; then\r\n\t\t\tlongs=(${longs&#x5B;@]} $1);\r\n\t\r\n\t\tfi\r\n\t\tshift;\r\n\tdone\r\n\r\n\tshift;\r\n\r\n\tshorts=${shorts&#x5B;@]}\t\t\t\r\n\r\n\tlongs=${longs&#x5B;@]}\r\n\r\n\tregex=${longs\/\/ \/\\|}\r\n\tregex=${regex\/\/:\/\\\\S*}\r\n\r\n\tsame=${same&#x5B;@]\/\/:\/}\r\n\r\n\tfor option in &quot;$@&quot;;do\r\n\t\tif echo $option|grep -q -P &#039;^--&#039;;then\r\n\r\n\t\t\techo $option|grep -q -P &quot;^--($regex)\\b&quot;\r\n\r\n\t\t\t&#x5B; &quot;$?&quot; = &quot;1&quot; ] &amp;&amp; echo &quot;$MY_PRG: unrecognized option &#039;$option&#039;&quot; &amp;&amp; return 1;\r\n\t\tfi\t\r\n\tdone;\r\n\r\n\tregex=$(echo ${same}|sed -e &#039;s: :\/;s\/\\\\&lt;:g;s:|:\\\\&gt;\/:g;s:^:\\\\&lt;:&#039;)\r\n\t\r\n\targs=($(getopt -l ${longs\/\/ \/,} -o ${shorts\/\/ \/,} -n $MY_PRG -s bash -- $@))\r\n\t\r\n\t&#x5B; &quot;$?&quot; = 1 ] &amp;&amp; return 1;\r\n\r\n\tlet index=0;\r\n\r\n\twhile &#x5B; &quot;${args&#x5B;$index]}&quot; != &quot;--&quot; ];do\r\n\r\n\t\tif &#x5B; ! -z &quot;${args&#x5B;$index]%%\\&#039;*}&quot; ];then\r\n\r\n\t    \toption=$(echo opt${args&#x5B;$index]}|sed -e &quot;s\/$regex\/;s\/-\\+\/_\/g&quot;)\r\n\t    \teval $option=1;\r\n\t\telse\r\n\t\t\teval $option=${args&#x5B;$index]\/\/\\&#039;\/}\r\n\t    fi\r\n\r\n\t\tlet index+=1\r\n\tdone\t    \r\n}\r\n\r\n\r\n##---------------- main --------------------##\r\n\r\n##-------------------------------------------##\r\nfunction main(){\r\ntrue;\r\n}\r\n#*********************************************#\r\n\r\n## Some script wide variables\r\nMY_PRG=`basename $0`\r\n_DATE=`date +%y%m%d%H%M`\r\n\r\n## Some global variables\r\ndeclare _TMP;\t## Holds temporary files for cleanup\r\n\r\n## Valid command line options\r\nGetopts \\\r\n\t&#039;h|help&#039;\\\r\n\t&#039;v|version&#039;\\\r\n\t-- $@\r\n\r\n&#x5B; &quot;$?&quot; = &quot;1&quot; ] &amp;&amp; try_help;\r\n\r\n&#x5B; ! -z $opt_help ] &amp;&amp; Help;\r\n\r\n&#x5B; ! -z $opt_version ] &amp;&amp; version;\r\n\r\ntime main;\r\nexit;\r\n###################################################\r\n## $Log$\r\n###################################################\r\n\r\n\r\n<\/pre><\/div>\r\n\r\n\r\n<p>Please feel free to reach out with any questions or comment. You can use the <a href=\"https:\/\/blog.al-zakirah202.familyds.com\/index.php\/contact-us\/\">Contact Us <\/a>to write to us.<\/p>\r\n<div id=\"emojics-root\"><\/div><div class=\"remoji_bar\"><div class=\"remoji_add_container\" data-remoji-id=\"443\" data-remoji-type=\"post\"><div class=\"remoji_add_icon\"><\/div><\/div><div class=\"remoji_error_bar\" data-remoji-id=\"443\" data-remoji-type=\"post\" style=\"display: none;\">Error happened.<\/div><\/div>","protected":false},"excerpt":{"rendered":"<p>One of the powerful features of the terminal app which&#8217;s available by default on Linux &amp; Mac OS is the unix shells it supports. \u00a0It offers plethora of unix commands which can be bunched together in a file (called &#8216;the script&#8217;) to run as a group. Error happened.<\/p>\n","protected":false},"author":1,"featured_media":447,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[24,16],"tags":[25,26],"class_list":["post-443","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-bash","category-terminal","tag-getopt","tag-scripting"],"_links":{"self":[{"href":"https:\/\/blog.al-zakirah202.familyds.com\/wordpress\/wp-json\/wp\/v2\/posts\/443","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.al-zakirah202.familyds.com\/wordpress\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.al-zakirah202.familyds.com\/wordpress\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.al-zakirah202.familyds.com\/wordpress\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.al-zakirah202.familyds.com\/wordpress\/wp-json\/wp\/v2\/comments?post=443"}],"version-history":[{"count":12,"href":"https:\/\/blog.al-zakirah202.familyds.com\/wordpress\/wp-json\/wp\/v2\/posts\/443\/revisions"}],"predecessor-version":[{"id":460,"href":"https:\/\/blog.al-zakirah202.familyds.com\/wordpress\/wp-json\/wp\/v2\/posts\/443\/revisions\/460"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/blog.al-zakirah202.familyds.com\/wordpress\/wp-json\/wp\/v2\/media\/447"}],"wp:attachment":[{"href":"https:\/\/blog.al-zakirah202.familyds.com\/wordpress\/wp-json\/wp\/v2\/media?parent=443"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.al-zakirah202.familyds.com\/wordpress\/wp-json\/wp\/v2\/categories?post=443"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.al-zakirah202.familyds.com\/wordpress\/wp-json\/wp\/v2\/tags?post=443"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}