Reference Bash variable in block

Hi All,

This may be a stupid question, but I have the following in my recipe:

bash ‘get user required’ do
code <<-EOH
GETUSER=$(ls /home | grep “myuser*”)
EOH
end

How do I reference the bash “GETUSER” variable below in my execute block?

execute ‘/tmp/chownMyStuff’ do
command "chown -R GETUSER:staff /tmp/myDir/"
user "root"
action :run
end

Cheers,
Simon

Ignore me, i found a better way of doing it!

Hi Simon could you please share your solution? I am having the same issue.
Thanks