So I have a shell script math.sh which takes a number as an argument and echos one added to it and one subtracted from it:
#!/bin/bash
echo "Add: "$(($1 + 1))
echo "Subtract : "$(($1 - 1))
and my other shell script execute.sh is basically taking math.sh and a textfile as an argument and writing the output of math.sh to the text file.
#! /bin/sh
echo $1 > $2
However, the two echos are outputting to the text file on the same line as:
Add: $(($1 ++)) Subtract : $(($1 --))
when I need it on separate lines like:
Add:$(($1 ++))
Subtract:$(($1 --))
How would I do this without editing math.sh? Because my execute.sh needs to be able to output any shell script to the text file, not just math.sh, on separate lines.