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

  • SEARCH
  • Home
  • 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 6707833
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T07:41:10+00:00 2026-05-26T07:41:10+00:00

In my bash_profile, I’m referencing an external alias.sh file, which has the following alias:

  • 0

In my bash_profile, I’m referencing an external alias.sh file, which has the following alias:

alias date="echo `date "+%Y-%m-%d at %H:%M":%S`"

If I issue date in a new terminal session, it constantly outputs the specific date at the time when the alias.sh file was sourced (i.e. when I started the new session) …

How do I make an alias that actually outputs the current date, when executing the aliased command?

  • 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-26T07:41:10+00:00Added an answer on May 26, 2026 at 7:41 am

    Uhh, why not just?

    alias date='date "+%Y-%m-%d at %H:%M":%S'
    

    No need to echo it. When you use the backwards tick ( ` ), whatever’s in it gets evaluated when alias.sh is sourced.

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

Sidebar

Related Questions

I added an alias in my .bash_profile file in my home directory on Mac
In a terminal window I run: export PATH=$PATH:/usr/local/mysql/bin>> ~/.bash_profile Then when I echo $PATH
I added some settings to .bash_profile and closing/opening terminal doesn't seem to have the
In my .bash_profile I have the following lines: PATHDIRS= /usr/local/mysql/bin /usr/local/share/python /opt/local/bin /opt/local/sbin $HOME/bin
I set an alias in my .bash_profile for Octave alias octave=open /Applications/Octave.app It opens
I've written the following bash profile settings file: BLACK=\[\033[0;30m\] DARK_GRAY=\[\033[1;30m\] LIGHT_GRAY=\[\033[0;37m\] BLUE=\[\033[0;34m\] LIGHT_BLUE=\[\033[1;34m\] GREEN=\[\033[0;32m\]
In Fabric, when I try to use any alias' or functions from my .bash_profile
I found the following bash statement in a tutorial: edit ~/.bash_profile When I run
I have the following line in a shell script: source bash_profile It does not
Possible Duplicate: How do I find .bash_profile and add to my shell's initialization file?

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.