I want to get the error output from compiling a C++ file using shellscript. When I pass argument to shellscript , for ex: argument is the name of the .cpp file : data.cpp,
and that argument seems only be able to deal with "echo" but not with g++ as:
g++ $1.cpp 2> err.txt
doesn't work
So I decided to call only the shellscript(without argument) and in that :
g++ *.cpp 2> err.txt
then it works
Is there any way to deal with this kind of argument for other commands , not with "echo" command purely (to write stream)