Reading crontab into bash array
I'm trying to get the contents of my crontab into a bash array with the following code
Code:
crontab -l > /home/test/cron.tmp Any idea what I'm doing wrong? Thanks |
Have you tried quoting the variable?
echo "${crons[@]}" 1> /home/test/out.tmp or echo '${crons[@]}' 1> /home/test/out.tmp |
Thanks for the reply, I've just solved it by using printf to write to the file instead of echo.
|
All times are GMT -5. The time now is 12:31 AM. |