I have command
store=`stat /some/path`
echo ${store}>>file.txt
then I echo the variable result in a file
Sometimes the file doesn't exists and I get an error as stat: cannot stat xxxx
However, when this error occurs, it is echoed to the stdout than stored in my variable. I would like even the error to be printed out. How can I capture the same?