How would I get this to work in ksh?
variable1="$(strings /.sh_history | grep '^\user' | tail -1 | cut -d' ' -f2)" variable2="$(command ${variable1})"
Basically, I would like to use variable1 as a string to use with a command to declare a variable.
UPDATE: The issue was not actually related to my syntax. The error was due to the text being formatted which created an issue. I cut using the text modifiers as delimiters and was able successfully pull the data. I did use both of the advised solutions to make my script cleaner.