I'm trying to add a timestamp to the log script that I have based on this solution. I'm new in bash, but I think this supossed to be working but it does not. Which part I did something wrong?
dothing.sh
:
#!/usr/bin/env bash
adddate() {
while IFS= read -r line; do
printf '%s %s\n' "$(date)" "$line";
done
}
/home/astden01a000/app/anaconda3/envs/dataengineer/bin/python "/scripts/ixi/bin/framework_develope/script/project_x/engine_trigger_file.py" "/scripts/ixi/bin/properties/CashX.cfg" "bulk" "prod" | adddate > /data04/eva/tax/hi/garu/outstanding/development/cronjob/log_run_ingest_cod.txt
But when I try to run the bash script bash dothing.sh
it says syntax error near unexpected token
$'{\r''``