{"id":756,"date":"2025-01-31T14:46:19","date_gmt":"2025-01-31T19:46:19","guid":{"rendered":"https:\/\/csic.som.emory.edu\/~lzhou\/blogs\/?p=756"},"modified":"2025-01-31T14:46:19","modified_gmt":"2025-01-31T19:46:19","slug":"tcsh-script-behavior-change","status":"publish","type":"post","link":"https:\/\/csic.som.emory.edu\/~lzhou\/blogs\/?p=756","title":{"rendered":"tcsh script behavior change"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">Recently I noticed a tcsh behavior change.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">CentOS7, Rocky 8, Ubuntu 20.04, Fedora 41, and Linux Mint if you have a string variable in tcsh,<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">like<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">set a=&#8221;mystring&#8221;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">and attempt to get its path when treating is as a filename:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">set b=&#8221;$a:h&#8221;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">it will return $a itself.  <\/p>\n\n\n\n<p class=\"wp-block-paragraph\">To be noted that the expect behavior when a=&#8221;mypath\/mystring&#8221;,<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">set b=&#8221;$a:h&#8221; <\/p>\n\n\n\n<p class=\"wp-block-paragraph\">get string $b as mypath<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">However, in Rocky9, $b will be &#8220;&#8221; empty string when $a does not contain any slash.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">This behavior caused some of our tcsh scripts to malfunction.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The reason is still under investigating.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Recently I noticed a tcsh behavior change. CentOS7, Rocky 8, Ubuntu 20.04, Fedora 41, and Linux Mint if you have a string variable in tcsh, like set a=&#8221;mystring&#8221; and attempt to get its path when treating is as a filename: set b=&#8221;$a:h&#8221; it will return $a itself. To be noted that the expect behavior when [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[21,3],"tags":[],"class_list":["post-756","post","type-post","status-publish","format-standard","hentry","category-computer-tips","category-mri-technical-support","post-blog"],"_links":{"self":[{"href":"https:\/\/csic.som.emory.edu\/~lzhou\/blogs\/index.php?rest_route=\/wp\/v2\/posts\/756","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/csic.som.emory.edu\/~lzhou\/blogs\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/csic.som.emory.edu\/~lzhou\/blogs\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/csic.som.emory.edu\/~lzhou\/blogs\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/csic.som.emory.edu\/~lzhou\/blogs\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=756"}],"version-history":[{"count":1,"href":"https:\/\/csic.som.emory.edu\/~lzhou\/blogs\/index.php?rest_route=\/wp\/v2\/posts\/756\/revisions"}],"predecessor-version":[{"id":757,"href":"https:\/\/csic.som.emory.edu\/~lzhou\/blogs\/index.php?rest_route=\/wp\/v2\/posts\/756\/revisions\/757"}],"wp:attachment":[{"href":"https:\/\/csic.som.emory.edu\/~lzhou\/blogs\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=756"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/csic.som.emory.edu\/~lzhou\/blogs\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=756"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/csic.som.emory.edu\/~lzhou\/blogs\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=756"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}