Hi in my script i've concatenated two files into a new file called output.txt. Am having trouble checking that output.txt file does exist to then print a "concatenation successful" message. The concatenation appears to work and create a new file.
cat $file1 $file2 >> output.txt
file3="$output.txt" #incorrect?
if [ -e $file3 ]
then
echo "concatenation of files successful"
fi
file3="output.txt".$outputis being replaced by a variable named output (which does not exist in the snippet posted here). If you move the file3 variable abovecat, you can use it for the output redirection as well to avoid repeating the filename twice.