UNIX shells script to echo out the date value


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers UNIX shells script to echo out the date value
# 1  
Old 05-07-2015
UNIX shells script to echo out the date value

I appreciate if someone answer this question for my learning purpose:

Given a filename structure of a COUNTRY CODE, file type, date (YYYYMMDD) and two digit attempt number with an extension of ".dat", write a UNIX shells script to echo out the date value.
Example: US_TRANSACTIONS_20090131_01.DAT would display 20090131
# 2  
Old 05-07-2015
Do not post classroom or homework problems in the main forums. Homework and coursework questions can only be posted in this forum under special homework rules.

Please review the rules, which you agreed to when you registered, if you have not already done so.

More-than-likely, posting homework in the main forums has resulting in a forum infraction. If you did not post homework, please explain the company you work for and the nature of the problem you are working on.

If you did post homework in the main forums, please review the guidelines for posting homework and repost.

Thank You.

The UNIX and Linux Forums.
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

UNIX script to replace old date with current date dynamically in multiple files present in a folder

I am trying to work on a script where it is a *(star) delimited file has a multiple lines starts with RTG and 3rd column=TD8 I want to substring the date part and I want to replace with currentdate minus 15 days. Here is an example. iam using AIX server $ cat temp.txt RTG*888*TD8*20180201~... (1 Reply)
Discussion started by: Shankar455
1 Replies

2. Programming

UNIX shells scripting

Can someone help by advising hw to built myself strong on logic building in UNIX shell scripting. I find it very difficult Sent from my iPhone using Tapatalk (4 Replies)
Discussion started by: Vijaykannan T
4 Replies

3. Shell Programming and Scripting

How to echo output of a UNIX command (like ls -l ) using shell script.?

How do i echo the output of a unix command using shell script??? Like: echo /etc/ ls -l (2 Replies)
Discussion started by: sunny2802
2 Replies

4. Shell Programming and Scripting

Echo date variable from data input to a script

Hi, I'm trying to make a script which you type the year, select the month and day and then create the date in the format 2010-12-7. #!/bin/bash dia () { echo " Seleccione el dia:" select file in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 Salir do... (6 Replies)
Discussion started by: iga3725
6 Replies

5. UNIX for Dummies Questions & Answers

changing shells in unix (im using putty)

hi. im new here. im taking a UNIX OS class and im in need of some help how do i change my shell in UNIX? for homework i need to edit the tcshrc file (to include aliases) in my home directory but its not there. so i think switching shells will create the file. am i correct? I'm using PuTTy.... (1 Reply)
Discussion started by: alpha_centauri
1 Replies

6. UNIX for Dummies Questions & Answers

How do I know what type of shells are available in my Unix system?

How do I know what type of shells are available in my Unix system? Are there a single command or environment variable that can let me find that out? Best regards, John Chan (7 Replies)
Discussion started by: shuhang2
7 Replies

7. Shell Programming and Scripting

Switching shells in UNIX Scripts

Solaris Newbie here to scripting in UNIX/SOLARIS. What I am looking to do is, once the script is executed, switch to /bin/bash shell and continue to execute the script. The problem I run into is once the script switches to the Bash shell, the script stops, and does not execute the... (2 Replies)
Discussion started by: Scoobiez
2 Replies

8. UNIX for Dummies Questions & Answers

echo date

Hi, How to display date using echo command. I tried "echo date" , it prints "date" not actual date only date command prints actual date. Thanks (4 Replies)
Discussion started by: avadhani
4 Replies

9. UNIX for Dummies Questions & Answers

Good Unix Shells ?

Hey Guys i am new to Unix and i have downlaoded Cygwin for Windows and deleted it. I was just wondering is there any good shells like that for windows that just as good thanks for your time ][ce (1 Reply)
Discussion started by: IceCold
1 Replies

10. Shell Programming and Scripting

perl as lanuage of shells in unix

hi, do shells in unix understand the language of perl? learning perl will make u a ultimate shell programmer? thanks (6 Replies)
Discussion started by: yls177
6 Replies
Login or Register to Ask a Question