• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: [OT] Shell scripting
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [OT] Shell scripting


  • Subject: Re: [OT] Shell scripting
  • From: "John W. Baxter" <email@hidden>
  • Date: Fri, 26 Dec 2003 08:51:26 -0800
  • Envelope-to: email@hidden

On 12/26/2003 0:30, "Marc K. Myers" <email@hidden> wrote:

> Being a complete novice at shell scripting I can't figure out how to
> add the date and time to the message my script sends to the console.
> Can someone tell me how to do that? Setting a variable to the output
> of a date command ought to be easy but my references don't tell me how
> to do it.

Change the echo command to something along these lines (watch line
wrapping):
echo "AppleFileServer restarted by autoAfpCheck at `date +%H:%M\ on\
%Y-%m-%d`"

Which gives
AppleFileServer restarted by autoAfpCheck at 08:46 on 2003-12-26

man strftime
will reveal the various codes you could use instead of what I used.

--John
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.

  • Follow-Ups:
    • Re: [OT] Shell scripting
      • From: Reinhold Penner <email@hidden>
References: 
 >[OT] Shell scripting (From: "Marc K. Myers" <email@hidden>)

  • Prev by Date: Re: new book
  • Next by Date: Re: [OT] Shell scripting
  • Previous by thread: [OT] Shell scripting
  • Next by thread: Re: [OT] Shell scripting
  • Index(es):
    • Date
    • Thread