I'm trying to execute git commands from a bash script.
code:
#!/bin/bash
echo "commit and push all files in this folder: "
INPUTPATH=""
FILENAME="README2"
PATH=""
if [ -s text.txt ]
then
echo "file is not empty"
INPUTPATH=$(<text.txt)
#echo "$INPUTPATH"
else
read INPUTPATH
echo "$INPUTPATH" > text.txt
fi
PATH="$INPUTPATH/$FILENAME"
for run in {1..10}; do
echo $RANDOM >> $PATH
done
cd $INPUTPATH && git commit -am "commit"
cd $INPUTPATH && git status
The script work's fine, besides the last two commands.
these are the error messages:
line 25: git: command not found line 26: git: command not found