'grep' is not recognized as an internal or external command
I am getting below error
My scripts are as below
echo Setup CI_HOME :
echo ****************************
echo export CI_HOME=/des_ci_teamcity>des_ci_cmd.sh
echo rm -rf $CI_HOME /DESAutomation>>des_ci_cmd.sh
echo git clone -b Dude-stream_unstable-jdk8 https://XXXXXXXXXXXX@github-XXX-01.XX.com/NBI/-XXXXXXXXXXXCOde.git /DESAutomation>>des_ci_cmd.sh
echo cd /DESAutomation >>des_ci_cmd.sh
echo ls | grep -v "DESAutomation" | xargs rm -fr >>des_ci_cmd.sh
echo mv /DESAutomation/DESAutomation/* /DESAutomation/>>des_ci_cmd.sh
echo rm -fr DESAutomation>>des_ci_cmd.sh
echo mv /DESAutomation/des_ci_teamcity $CI_HOME/>>des_ci_cmd.sh
echo rm -fr /DESAutomation>>des_ci_cmd.sh
echo BEGIN: des_ci_cmd.sh
type des_ci_cmd.sh
echo END: des_ci_cmd.sh
echo y |%teamcity.agent.home.dir%\tools\plink.exe -ssh -P 22 -pw dost1234 root@%DES_SERVERS_HOST_NAME% -m des_ci_cmd.sh
can some one help me on this ?
Please sign in to leave a comment.
I don't see a big reason for that not to work, I've tried to reproduce it by adding an echo ls -l | grep "something" >> file and it seems to have worked just fine. Is that the full content of the script? Can you check what happens when removing the "grep" bit from it? Because it sounds weird that an "echo >>file" that should push all the content into a file gets disrupted by that.