tcsh script behavior change

By: | Comments: No Comments

Posted in categories: Computer Tips, Work related

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=”mystring”

and attempt to get its path when treating is as a filename:

set b=”$a:h”

it will return $a itself.

To be noted that the expect behavior when a=”mypath/mystring”,

set b=”$a:h”

get string $b as mypath

However, in Rocky9, $b will be “” empty string when $a does not contain any slash.

This behavior caused some of our tcsh scripts to malfunction.

The reason is still under investigating.

Be the first to comment!

Leave a Reply