Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 633647
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T20:12:33+00:00 2026-05-13T20:12:33+00:00

Cygwin user here (though if there’s a suitable solution I will carry it over

  • 0

Cygwin user here (though if there’s a suitable solution I will carry it over to K/Ubuntu, which I also use).

I have a Welcome message in my .bashrc that looks like the following:

SAD=(`date +%A-%B-%d-%Y`)
DUB=(`date -u +%k:%M`)
printf "Today's Date is: ${SAD}.\n"
printf "Dublin time is now ${DUB}. (24-Hour Clock)\n"

After numerous attempts to use whitespaces in the variable SAD above, I gave in and used hyphens. But I am, understandably, not satisfied with this band-aid solution. The problem, as I recall, was that every time I tried using quoted space, \s or some similar escape tag, along with the variables listed in the appropriate section of the GNU manpage for date, the variable for Year was either ignored or returned an error. What I do’nt want to have to do is resort to the full string as returned by date, but rather to keep the order in which I have things in the code above.

As I write this, it occurs to me that setting the IFS around this code for the Welcome message may work, provided I return it to defaults afterwards (the above appears at lines 13-17 of a 68-line .bashrc). However, I can’t recall how to do that, nor am I sure that it would work.

Generally-speaking, .bashrc files are in valid BASH syntax, aren’t they? Mine certainly resemble the scripts I’ve either written myself or tested from other sources. All I’m missing, I suppose, is the code for setting and unsetting the field separators around this message block.

No doubt anyone who comes up with a solution will be doing a favor not only to me, but to any other relative newbies on the Net taking their first (or thirteenth through seventeenth) steps in the world of shell scripting.

BZT

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T20:12:33+00:00Added an answer on May 13, 2026 at 8:12 pm

    Putting

    SAD=$(date "+%A %B %d %Y")
    DUB=$(date -u +%k:%M)
    echo "Today's Date is: ${SAD}."
    echo "Dublin time is now ${DUB}. (24-Hour Clock)"
    

    in my .bash_profile prints

    Today's Date is: Thursday February 18 2010.
    Dublin time is now 12:55. (24-Hour Clock)
    

    I think that’s what you want.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 338k
  • Answers 338k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer You are probably looking for VSTA, Visual Studio Tools for… May 14, 2026 at 4:20 am
  • Editorial Team
    Editorial Team added an answer Long Tail offer a free flvplayer called JW Player. This… May 14, 2026 at 4:20 am
  • Editorial Team
    Editorial Team added an answer This is also available in web.xml: <error-page> <exception-type>UnhandledException</exception-type> <location>UnhandledException.jsp</location> </error-page>… May 14, 2026 at 4:20 am

Related Questions

Here's my goal : I have a Windows XP PC with all the source
Suppose I've got some Arch Linux installation which I'd like to distribute among students
I have this method: private delegate void watcherReader(StreamReader sr); private void watchProc(StreamReader sr) {
Using Cygwin Perl v5.8.8 and Win32::TieRegistry 0.26. We can get a tied hash object
running cygwin on windows I can connect and execute X applications with no further

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.