I have two shell scripts like
mem.sh
RESULT=$(awk {print} /proc/meminfo)
r="$(./test.sh)"
RESULT="$RESULT$r"
echo ${RESULT#* }
exit ${RESULT%% *}
test.sh
echo "HI"
When I execute mem.sh locally it will print memory info followed by HI without any error, but I am in need of executing that script in remote machine, I am doing it like below
cat mem.sh | ssh user@ip >> result.txt
I am getting error like
unexpected EOF while looking for matching `"'
syntax error: unexpected end of file
I could't find solution, Please help me on this or Is there any way to do this?
Question #2: Is there any way to execute multiple shell scripts(available in local machine) in remote machine?
I am using linux machine.