• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 359
  • Last Modified:

Space after comma? UNIX

how do I put a space after comma in UNIX?
date  +%A,%B%d,%Y
0
ourbhoy
Asked:
ourbhoy
  • 6
  • 3
  • 2
1 Solution
 
TintinCommented:
date +"%A,%B%d, %Y"
0
 
ozoCommented:
date  '+%A, %B%d, %Y'
0
 
ourbhoyAuthor Commented:
I think I need to rephrase the question. I want to print out the date using the format below, and this script works, but it does not place a space between the commas. If I put a space in there like ozo's comment, I get an illegal format message. If I use Tintin's comment the output is exactly what is in the quotes: percent symbol and letters.

echo "Today is `date +%A,%B,%d,%Y`"
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
ozoCommented:
echo "Today is `date '+%A, %B, %d, %Y'`"
0
 
ozoCommented:
date +"Today is %A, %B, %d, %Y"
0
 
ozoCommented:
echo "Today is `date +%A,\ %B,\ %d,\ %Y`"
0
 
TintinCommented:
ozo's pretty much covered all the bases there.   :-)
0
 
ourbhoyAuthor Commented:
I have tried the different combinations, and none of them give me the result
0
 
ozoCommented:
What results do you get?
Is there anything you've left out of the question?
0
 
ourbhoyAuthor Commented:
The fourth one works. I did not enter spaces after the comma and after the back slash. The spaces are hard to notice. Thank you ozo.
echo "Today is `date +%A,\ %B%d,\ %Y`"
0
 
ozoCommented:
The others should have worked too, are you sure they were entered correctly?
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 6
  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now