Solved

Shifting through the elements of "date" - Bourne Shell

Posted on 2011-02-17
3
396 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Exchange 2010 get-mailbox and get-mailboxstatistics 10 194
filter a list of processes without using grep -v 6 47
Shell Mail is not working 5 90
Shell Script on AIX 7 61
Over the years I've spent many an hour playing on hardened, DMZ'd servers, with only a sub-set of the usual GNU toy's to keep me company; frequently I've needed to save and send log or data extracts from these server back to my PC, or to others, and…
How to remove superseded packages in windows w60 or w61 installation media (.wim) or online system to prevent unnecessary space. w60 means Windows Vista or Windows Server 2008. w61 means Windows 7 or Windows Server 2008 R2. There are various …
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…
A company’s greatest vulnerability is their email. CEO fraud, ransomware and spear phishing attacks are the no1 threat to a company’s security. Cybercrime is responsible for the largest loss of money to companies today with losses projected to r…

943 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

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now