GOAL: As the title suggests i'm needing to pass the results of a function to a variable. Specifically, LASTLOG() { wevtutil qe "$WINLOG" //c:1 //rd:.ture //f:text }
This primary command is wevtutil qe "$WINLOG" //c:1 //rd:.ture //f:text
.
ISSUE: Originally I did the following LASTLOG=$(wevtutil qe "$WINLOG" //c:1 //rd:.ture //f:text)
, but i've been informed that passing cmds to variables is not best practice so I created a function. LASTLOG() { wevtutil qe "$WINLOG" //c:1 //rd:.ture //f:text }
--however I cant seem to pass the ouput of the function to a variable for later comparison.