I have the below cmd in extract.sh .
It works when execute in terminal to search for "ABC123" in orig.txt and output to result.txt the remaining content after "ABC123" is found.
Unfortunately when I run the script via cron/crontab, it seem to ignore/skip the "more" command and just output orig.txt to result.txt.
Any help is appreciated.
---------------------extract.sh-----------------------------------------
#!/bin/bash
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
. $HOME/.profile
more +/"ABC123" orig.txt > result.txt
----------------------crontab-------------------------------------------
SHELL=/bin/bash
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
* * * * * /root/extractpdf_v3.sh
* * * * * /bin/bash /root/extract.sh
morecommand to do when it’s running undercron? And what, exactly, does it do?orig.txtlikemore +/"ABC123" /path/to/orig.txt > /path/to/result.txtand once escape the plusSlash\+\/sign there+option tomore, but please note thatmoreis still meant as an interactive viewer. Anyhow, did you try with pull paths of the files given?