You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I came across this same issue while yak shaving modulinos.
I'm trying to get if [ "$_" = */scriptedmain ] to match when the script is run in the same directory the script is stored in, as ./scriptedmain. Tried converting the if expression into a case expression, but unlike other shells, fish doesn't allow case wildcards to match dotfiles.
I changed tactics, tried adding an -o union conditional to the if to match against the dot version more explicitly, but silly fish forgot to add -a/-o to string matching conditionals.
As a workaround, I'm using an else if instead of -o, but this results in nasty code repetition. A workaround for -a string matching is to nest two if string match blocks.
Activity
mcandre commentedon Aug 15, 2014
+1
I came across this same issue while yak shaving modulinos.
I'm trying to get
if [ "$_" = */scriptedmain ]to match when the script is run in the same directory the script is stored in, as./scriptedmain. Tried converting theifexpression into acaseexpression, but unlike other shells, fish doesn't allow case wildcards to match dotfiles.I changed tactics, tried adding an
-ounion conditional to theifto match against the dot version more explicitly, but silly fish forgot to add-a/-oto string matching conditionals.As a workaround, I'm using an
else ifinstead of-o, but this results in nasty code repetition. A workaround for-astring matching is to nest twoifstring match blocks.lilyball commentedon Apr 1, 2015
This also fails when using boolean logic operators like
-a: