It is more or less well known that the ouput of a shell command can be redirected to a file via “>”. To assign a variable with the value of the command output, one has to use the quotes ` ` instead of ” ” or ‘ ‘ . For example,
$ set var = ` cat * | grep “text” | cut -d . -f1`
leads to evaluation of the command and assigning the result to the value of the variable var. This makes sense in all cases where the result of the command should not only be stored but is used in further commands.
Advertisement