Linux script works on RHEL 6.8 but not on RHEL 7.2

**The following script works on RHEL 6.8 , but when running on the RHEL 7.2 the script runs but there is no data in the file. However from the local machine I can run the created script (./avversion.sh) from the besclient custom site directory that was created from below and it runs and creates the file with data when I logon as root to the local machine. I do not have to chmod the file permissions prior to running the created script. I can run the command **
"/usr/bin/clamscan -V >> /opt/BESClient/bin/ClamAVversion.csv" locally on the machine and it runs and creates the file with data.

I can substitute other commands in the below script and they execute without issue.

// Enter your action script here
//ADD CODE HERE TO CREATE “AVversion” FILES.
delete __appendfile
if {name of operating system contains “inux”}
appendfile #!/bin/sh
appendfile /usr/bin/clamscan -V >> /opt/BESClient/bin/ClamAVversion.csv
delete "avversion.sh"
delete "{pathname of parent folder of client}/ClamAVversion.csv"
move __appendfile "avversion.sh"
wait chmod +x avversion.sh
wait ./avversion.sh
endif

Works on Linux Red Hat Enterprise Server 6.8 (2.6.32-573.22.1.el6.x86_64)
Broken on computer.wr.com Linux Red Hat Enterprise Server 7.2 (3.10.0-327.13.1.el7.x86_64)

check to see if there’s differences between the bigfix client’s environment (env) between the RHEL 6.* and the 7.* and also between your environment when using the root user interactively.
See this topic

checking now for results

Okay,

**Again the task that runs the script for RHEL 6 ran and output data, but did not output data on RHEL7. However if I run the script that was created by appendfile locally it runs and outputs with data. **
Below is the env , first is run locally on RHEL 7. 2nd is command in bigfix task that runs on RHEL 6 and RHEL 7 (RHEL 7 is same computer. Do you see anything that sticks out?

Ran local on version 7

[root@uxemssiemfwd1 CustomSite_NERC_CIP_V5]# env
XDG_SESSION_ID=39557
HOSTNAME=uxemssiemfwd1.wr.com
SELINUX_ROLE_REQUESTED=
TERM=xterm
SHELL=/bin/bash
HISTSIZE=1000
SSH_CLIENT=138.230.77.40 55462 22
SELINUX_USE_CURRENT_RANGE=
SSH_TTY=/dev/pts/0
USER=root
LS_COLORS=rs=0:di=01;34:ln=01;36:mh=00:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:mi=01;05;37;41:su=37;41:sg=30;43:ca=30;41:tw=30;42:ow=34;42:st=37;44:ex=01;32:.tar=01;31:.tgz=01;31:.arc=01;31:.arj=01;31:.taz=01;31:.lha=01;31:.lz4=01;31:.lzh=01;31:.lzma=01;31:.tlz=01;31:.txz=01;31:.tzo=01;31:.t7z=01;31:.zip=01;31:.z=01;31:.Z=01;31:.dz=01;31:.gz=01;31:.lrz=01;31:.lz=01;31:.lzo=01;31:.xz=01;31:.bz2=01;31:.bz=01;31:.tbz=01;31:.tbz2=01;31:.tz=01;31:.deb=01;31:.rpm=01;31:.jar=01;31:.war=01;31:.ear=01;31:.sar=01;31:.rar=01;31:.alz=01;31:.ace=01;31:.zoo=01;31:.cpio=01;31:.7z=01;31:.rz=01;31:.cab=01;31:.jpg=01;35:.jpeg=01;35:.gif=01;35:.bmp=01;35:.pbm=01;35:.pgm=01;35:.ppm=01;35:.tga=01;35:.xbm=01;35:.xpm=01;35:.tif=01;35:.tiff=01;35:.png=01;35:.svg=01;35:.svgz=01;35:.mng=01;35:.pcx=01;35:.mov=01;35:.mpg=01;35:.mpeg=01;35:.m2v=01;35:.mkv=01;35:.webm=01;35:.ogm=01;35:.mp4=01;35:.m4v=01;35:.mp4v=01;35:.vob=01;35:.qt=01;35:.nuv=01;35:.wmv=01;35:.asf=01;35:.rm=01;35:.rmvb=01;35:.flc=01;35:.avi=01;35:.fli=01;35:.flv=01;35:.gl=01;35:.dl=01;35:.xcf=01;35:.xwd=01;35:.yuv=01;35:.cgm=01;35:.emf=01;35:.axv=01;35:.anx=01;35:.ogv=01;35:.ogx=01;35:.aac=01;36:.au=01;36:.flac=01;36:.mid=01;36:.midi=01;36:.mka=01;36:.mp3=01;36:.mpc=01;36:.ogg=01;36:.ra=01;36:.wav=01;36:.axa=01;36:.oga=01;36:.spx=01;36:*.xspf=01;36:
MAIL=/var/spool/mail/root
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/root/bin
PWD=/var/opt/BESClient/__BESData/CustomSite_NERC_CIP_V5
LANG=en_US.UTF-8
SELINUX_LEVEL_REQUESTED=
HISTCONTROL=ignoredups
SHLVL=1
HOME=/root
LOGNAME=root
SSH_CONNECTION=138.230.77.40 55462 138.230.112.37 22
LESSOPEN=||/usr/bin/lesspipe.sh %s
XDG_RUNTIME_DIR=/run/user/0
_=/usr/bin/env
OLDPWD=/var/opt/BESClient/__BESData

Version 6

[root@uxsiemidx1 tmp]# cat besenv
BESClientActionMastheadPath=/etc/opt/BESClient/actionsite.afxm
TERM=linux
SYSTEMCTL_SKIP_REDIRECT=1
PATH=/sbin:/usr/sbin:/bin:/usr/bin
_=/bin/env
runlevel=3
RUNLEVEL=3
LANGSH_SOURCED=1
PWD=/var/opt/BESClient/__BESData/CustomSite_NERC_CIP_V5
LANG=en_US.UTF-8
previous=N
PREVLEVEL=N
CONSOLETYPE=vt
SHLVL=7
UPSTART_INSTANCE=
UPSTART_EVENTS=runlevel
UPSTART_JOB=rc
DISPLAY=:0.0
XAUTHLOCALHOSTNAME=localhost
XAUTHORITY=.Xauthority
[root@uxsiemidx1 tmp]#

Version 7

[root@uxemssiemfwd1 tmp]# cat besenv
BESClientActionMastheadPath=/etc/opt/BESClient/actionsite.afxm
XDG_SESSION_ID=39098
HOSTNAME=uxemssiemfwd1.wr.com
SELINUX_ROLE_REQUESTED=
SHELL=/bin/bash
TERM=xterm
HISTSIZE=1000
SSH_CLIENT=138.230.77.40 58102 22
SELINUX_USE_CURRENT_RANGE=
SYSTEMCTL_SKIP_REDIRECT=1
SSH_TTY=/dev/pts/0
USER=root
LS_COLORS=rs=0:di=01;34:ln=01;36:mh=00:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:mi=01;05;37;41:su=37;41:sg=30;43:ca=30;41:tw=30;42:ow=34;42:st=37;44:ex=01;32:.tar=01;31:.tgz=01;31:.arc=01;31:.arj=01;31:.taz=01;31:.lha=01;31:.lz4=01;31:.lzh=01;31:.lzma=01;31:.tlz=01;31:.txz=01;31:.tzo=01;31:.t7z=01;31:.zip=01;31:.z=01;31:.Z=01;31:.dz=01;31:.gz=01;31:.lrz=01;31:.lz=01;31:.lzo=01;31:.xz=01;31:.bz2=01;31:.bz=01;31:.tbz=01;31:.tbz2=01;31:.tz=01;31:.deb=01;31:.rpm=01;31:.jar=01;31:.war=01;31:.ear=01;31:.sar=01;31:.rar=01;31:.alz=01;31:.ace=01;31:.zoo=01;31:.cpio=01;31:.7z=01;31:.rz=01;31:.cab=01;31:.jpg=01;35:.jpeg=01;35:.gif=01;35:.bmp=01;35:.pbm=01;35:.pgm=01;35:.ppm=01;35:.tga=01;35:.xbm=01;35:.xpm=01;35:.tif=01;35:.tiff=01;35:.png=01;35:.svg=01;35:.svgz=01;35:.mng=01;35:.pcx=01;35:.mov=01;35:.mpg=01;35:.mpeg=01;35:.m2v=01;35:.mkv=01;35:.webm=01;35:.ogm=01;35:.mp4=01;35:.m4v=01;35:.mp4v=01;35:.vob=01;35:.qt=01;35:.nuv=01;35:.wmv=01;35:.asf=01;35:.rm=01;35:.rmvb=01;35:.flc=01;35:.avi=01;35:.fli=01;35:.flv=01;35:.gl=01;35:.dl=01;35:.xcf=01;35:.xwd=01;35:.yuv=01;35:.cgm=01;35:.emf=01;35:.axv=01;35:.anx=01;35:.ogv=01;35:.ogx=01;35:.aac=01;36:.au=01;36:.flac=01;36:.mid=01;36:.midi=01;36:.mka=01;36:.mp3=01;36:.mpc=01;36:.ogg=01;36:.ra=01;36:.wav=01;36:.axa=01;36:.oga=01;36:.spx=01;36:*.xspf=01;36:
PATH=/sbin:/usr/sbin:/bin:/usr/bin
MAIL=/var/spool/mail/root
_=/bin/env
PWD=/var/opt/BESClient/__BESData/CustomSite_NERC_CIP_V5
LANG=en_US.UTF-8
SELINUX_LEVEL_REQUESTED=
HISTCONTROL=ignoredups
HOME=/root
SHLVL=4
LOGNAME=root
SSH_CONNECTION=138.230.77.40 58102 138.230.112.37 22
LESSOPEN=||/usr/bin/lesspipe.sh %s
DISPLAY=:0.0
XDG_RUNTIME_DIR=/run/user/0
XAUTHLOCALHOSTNAME=localhost
XAUTHORITY=.Xauthority
[root@uxemssiemfwd1 tmp]#

I have tried moving the file to another directory and there was no change.

I have changed the command from clamscan -V to sigtool -V and that runs on both OS types with no problem. So I am not putting any more effort into this. If there is any insight that would be great.