I have saved the commands in a file and trying to read it from another file. commands without a pipe are working fine but wherever there is a pipe in command it is not getting executed.
can anyone help me out?
#!/bin/bash rm -f /ZLD_Implement/ZLD_Implement.txt while IFS=#, read -r Command_info1 Command; do variable1=$Commandenter code here echo "$Command_info1" >> /ZLD_Implement/ZLD_Implement.txt echo "`$variable1`" >> /ZLD_Implement/ZLD_Implement.txt done < /ZLD_Implement/ZLD_Command_list.txt
[root@localhost ZLD_Implement]# cat ZLD_Command_list.txt Command to check the hostname # hostname Command to check the linux kernel version # uname -a Command to check the current system date # dateer code here Command to check Disk space # df -kh Command to cheeck routes in Netstat # netstat -nrv command to check audit logs # ausearch -i -m USER_CHAUTHTOK,USER_MGMT,USER_AUTH` -if /var/log/audit/audit.log|tail -50nter code here