0
TOMCAT_FILE=/sys/project/apache-tomcat-8.5.47.tar.gz
if [ -e "$TOMCAT_FILE" ]
then
    echo "##############"
    echo ""
    echo "Installing Tomcat"
    tar zxf $TOMCAT_FILE -C /sys/project/
    echo "##############"
    echo "Tomcat Installation completed"
    mv  $TOMCAT_FILE/apache-tomcat-8.5.47
    echo "tomcat source file moved to apache"
    echo "Removing tomcat tar file from the current directory"
    rm -rf $TOMCAT_FILE/apache-tomcat-8.5.47.tar.gz
    echo "tomcat tar file removed"
fi

I have bash script to install tomcat, after installing tomcat tar file, i need rename the tomcat file like this (apache-tomcat-8.5.47 to apache), but when i running the scripts file renaming & deleting is not happened when i am checking my source directory /sys/project/.

Can you please some one suggest me how to achieve this task.

0

1 Answer 1

2
mv $TOMCAT_FILE/apache-tomcat-8.5.47

cannot work since need to specify where you want to move it to, probably something like

mv /sys/project/apache-tomcat-8.5.47 /sys/project/apache
Sign up to request clarification or add additional context in comments.

3 Comments

Failed again Installing Tomcat ############## Tomcat Installtion completed mv: failed to access '/sys/project/apache-tomcat-8.5.47.tar.gz/apache': Not a directory
@Anji I adapted my answer. please try to analyse yourself what might be the problem by analysing the output. That will go faster than asking on stackoverflow each time.
Thanks lot Chris.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.