On ESXi Hypervisor, If I run a command on the terminal via SSH, the commands are logged in the shell.log file, i.e if i run this command
[root@esxi04:~] ls -la
then I can see this command in shell.log file as:
<164>2023-02-22T09:34:24.337Z test_host shell[68783]: [root]: ls -la
But If I use a shell script instead, like this
#!/bin/sh
echo "Test"
ls -la
find / -name "*.log" -exec /bin/rm -rf {} \;
and run this script, the commands executed are not logged in shell.log file.
Is there any way I can log all these commands run through shell script as well? How to do so?