Solved

Shifting through the elements of "date" - Bourne Shell

Posted on 2011-02-17
3
412 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

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…
Background Still having to process all these year-end "csv" files received from all these sources (including Government entities), sometimes we have the need to examine the contents due to data error, etc... As a "Unix" shop, our only readily …
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…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

688 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