Output to shell variable

head -n 1 ~/.fvwm/config | grep -c "some-string"

It's the output from grep I need to put into a shell variable.

Also - I appreciate tips for other commands giving the same output.

If you're using kshell or bash then this will work:

variable=$(head -n 1 ~/.fvwm/config | grep -c "some-string")
1 Like

That worked, thank you very much.

/Swepter