Re: Create log file from script code..



On 2006-03-30, Geir Holmavatn wrote:
"Bit Twister" <BitTwister@xxxxxxxxxxxxxxxx> skrev i melding
news:slrne2oj19.3lu.BitTwister@xxxxxxxxxxxxxxxxxx

Hi, and thanks for the answer.

I forgot to say this this is with mOnOwall which is based on FreeBSD, if
that makes any difference.

lots of code examples in /etc/init.d

The mOnOwall distro unfortunately does not have any /etc/init.d folder

echo "MyScript started $(date) " >> /tmp/cronjobs.log

However I get an illegal variable name at the $(date) statement. Maybe the
FreeBSD has a completely other syntax..?

Unless /bin/sh is not a POSIX shell (which it normally is on
FreeBSD), that should work.

Try it with a Bourne shell syntax:

echo "MyScript started `date` " >> /tmp/cronjobs.log

If that works, you are dealing with a Bourne shell rather than a
POSIX shell (such as bash or ksh).

I realise that it might probably be more appropriate to ask in a FreeBSD
group...

If it's a shell scripting question, it would be more appropriate in
comp.unix.shell.

--
Chris F.A. Johnson, author | <http://cfaj.freeshell.org>
Shell Scripting Recipes: | My code in this post, if any,
A Problem-Solution Approach | is released under the
2005, Apress | GNU General Public Licence
.



Relevant Pages

  • Re: stdout/stderr/???
    ... The difference is not Linux vs FreeBSD but a question ... of the shell you are using -- I assume 'bash' under Linux ... An infinite loop while running or compiling the driver code? ... > tty, but that tty does not accept input ...
    (freebsd-questions)
  • Re: Backspace
    ... But actually I'm using Bourne shell on FreeBSD 6.1 just like the ... Solaris in lab, and the FreeBSD is freshly installed, I have checked ... I think Solaris was just like the above. ... shells in UNIX environments have startup files to customize the key ...
    (freebsd-questions)
  • Re: Backspace
    ... But actually I'm using Bourne shell on FreeBSD 6.1 just like the ... Solaris in lab, and the FreeBSD is freshly installed, I have checked ... Programs like emacs generally use terminfo and termcap databases that define keys and other terminal capabilities. ... >> MailScanner thanks transtec Computers for their support. ...
    (freebsd-questions)
  • Re: Default users and the passwords
    ... >FreeBSD, like almost all Unix OS, has other default users, like uucp, ... the 'toor' account is locked by default. ... IIRC, the purpose of toor is to have a different shell for root (ie: ...
    (FreeBSD-Security)
  • RE: New Freebsd Install Guide Available
    ... > documentation, which, of necessity, needs to be written in a rather ... > one would think it is impossible to run FreeBSD without Gnome. ... So, for example in my book all examples were Bourne shell, because ...
    (freebsd-questions)