fortify / fcli

fcli is a command-line utility for interacting with various Fortify products
https://fortify.github.io/fcli/
Other
34 stars 22 forks source link

fcli ssc app get --session session {?varName:attrName} -> variable not picked in zsh // MAC #208

Closed xakrurychle closed 1 year ago

xakrurychle commented 1 year ago

to be able to use a saved variable in another command the user has to switch to bash Screenshot 2022-12-19 at 15 46 02 Screenshot 2022-12-19 at 15 46 25

rsenden commented 1 year ago

Apparently, {?id:id} is interpreted by zsh instead of being passed to fcli. We already have some information about properly quoting/escaping the ? variable (see https://fortify-ps.github.io/fcli/#fcli-variables), we should probably update this information to state that on some shells, named variable references like in this example may also need to be quoted/escaped. On zsh, I guess things will work fine if you use single quotes around '{?id:id}', can you verify?

xakrurychle commented 1 year ago

Apparently, {?id:id} is interpreted by zsh instead of being passed to fcli. We already have some information about properly quoting/escaping the ? variable (see https://fortify-ps.github.io/fcli/#fcli-variables), we should probably update this information to state that on some shells, named variable references like in this example may also need to be quoted/escaped. On zsh, I guess things will work fine if you use single quotes around '{?id:id}', can you verify?

yes it works with '{?id:id}'

rsenden commented 1 year ago

Updated documentation to indicate that named variable references may also need to be quoted/escaped: https://fortify-ps.github.io/fcli/#fcli-variables