Solved

Shifting through the elements of "date" - Bourne Shell

Posted on 2011-02-17
3
404 Views
Last Modified: 2012-05-11
I'm not really sure how to start doing this... but i have to write a script that saves the current date in a variable and then shifts through the different parts/elements of the date using a loop and prints each one out in a separate line.

If anyone can just point me out what to research so I can get started with this i'd be thankful... at the moment i'm kinda clueless on how to do this.  would I be using grep or something?
0
Comment
Question by:nocturn4l
  • 2
3 Comments
 
LVL 84

Accepted Solution

by:
ozo earned 500 total points
ID: 34914841
date=`date`
for d in $date ;  do echo $d ; done
0
 

Author Comment

by:nocturn4l
ID: 34914862
thanks, gonna look into that right now, gonna keep this post open for now till i get that done. thanks again
0
 

Author Comment

by:nocturn4l
ID: 34914890
ah wow that works... i didn't understand how at first but just went over the for..do..done part of my book and it makes sense.. dont think i would've came up with that myself otherwise.  thanks a million
0

Featured Post

VMware Disaster Recovery and Data Protection

In this expert guide, you’ll learn about the components of a Modern Data Center. You will use cases for the value-added capabilities of Veeam®, including combining backup and replication for VMware disaster recovery and using replication for data center migration.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Correct syntax to upload file in a script using sftp 2 83
LINUX ZIP - UNCOMPRESS WINDOWS PATH 3 100
Remote install of MSI file 4 48
Shell Script on AIX 7 99
Recently, an awarded photographer, Selina De Maeyer (http://www.selinademaeyer.com/), completed a photo shoot of a beautiful event (http://www.sintjacobantwerpen.be/verslag-en-fotoreportage-van-de-sacramentsprocessie-door-antwerpen#thumbnails) in An…
Active Directory replication delay is the cause to many problems.  Here is a super easy script to force Active Directory replication to all sites with by using an elevated PowerShell command prompt, and a tool to verify your changes.
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
This Micro Tutorial will teach you how to censor certain areas of your screen. The example in this video will show a little boy's face being blurred. This will be demonstrated using Adobe Premiere Pro CS6.

832 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question