Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

6
  • Also, the while($true). It actually works, but it's bogus as it relies on the variable true having an empty value, or being o simple command that returns success. I.e., running this with true=false would not work. Better with while true; do ...; done. Commented May 5, 2021 at 8:51
  • @Kusalananda yes, works if $true is the name of a command. Or if it is a non-0 number and you use while (($true)). Commented May 5, 2021 at 8:57
  • @SoftProgrammer because the cron script is likely not running from your home directory. In any case, as I said in the answer, you don't tell us how it "does not work" so all I can do is guess. Commented May 5, 2021 at 9:11
  • @terdon thanks a lot. The problem was on specifying the path of bcp. Commented May 5, 2021 at 9:44
  • Always paste your script into https://shellcheck.net, a syntax checker, or install shellcheck locally. Make using shellcheck part of your development process. Commented May 5, 2021 at 13:59