Pardon my lack of knowledge here. I'm having trouble getting this BASH code to NOT output a newline
I don't want the output to include a newline character. I think the culprit is the program "cut" which automatically adds a newline to the output.
The other option is right after this command to go back into the file and remove the newline. Either way, I don't want a newline at the end of the cut text that gets piped to tee.
I am aware that I can just stream the output to the $OUTPUT_FILE" (which doesn't help any) but I prefer to use tee at this moment.
Anyway, can someone please help me? I don't know how to do either of the solutions.
Thanks in advance
Code:
cat "$datafile" | fgrep -A 4 "$STEP_STRING"|grep "$STEP_FILTER" | cut -c 49-56 |tee -a "$OUTPUT_FILE"
I don't want the output to include a newline character. I think the culprit is the program "cut" which automatically adds a newline to the output.
The other option is right after this command to go back into the file and remove the newline. Either way, I don't want a newline at the end of the cut text that gets piped to tee.
I am aware that I can just stream the output to the $OUTPUT_FILE" (which doesn't help any) but I prefer to use tee at this moment.
Anyway, can someone please help me? I don't know how to do either of the solutions.
Thanks in advance