file related issue


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting file related issue
# 1  
Old 11-09-2004
file related issue

Hi all,

Anybody knows how to write a script to
open a file and store the weekday(mon-sun) on first line and current datetime on
the second line of the file.
If file doesn't exist, create a new one and store the weekday and current datetime.
If it already exists, open it and get both weekday and the datetime.
compare this date(got from file) with the current datetime.
Display only the difference.
Before closing the script put the weekday and the current date(i.e., whichever day and time the script is called) in the file on the 1st and 2nd line resp.

Please help with the code.

Thanks in advance

k_oops
# 2  
Old 11-09-2004
Do you have some code that you have written for the problem.
If you have please share with the others and if you have'nt I believe you should read the forum rules https://www.unix.com/showthread.php?threadid=2971
before posting

See Point 6
# 3  
Old 11-09-2004
I must agree with encrypted - this could be interpreted as a homework problem due to the complex nature of the request and the lack of any kind of script that you've done to show that it's a problem that you've been working on yourself.

Please don't let this stop you posting in future, but be aware of the forum rules, and please do not post homework questions on these boards - if you are having problems your tutor will be happy to help.

In future (and of course, if this isn't homework), please post what you have done so far, and then people will be willing to help you with your problems, not do them for you.

Cheers
ZB

Last edited by zazzybob; 11-09-2004 at 08:11 PM..
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Need help in an issue related to mailx

Hello, I have a file temp.txt with the below contents : Sep 9 03:04:51 adcsdp01 MAPDR2_00: Unable to open trace file adpstartarv.log. (Error 110 Resource temporarily unavailable) Sep 9 03:05:35 adcsdp01 MAPDR2_00: SAP Service ADPMR2_00 successfully started. Sep 9 03:04:51 adcsdp01... (7 Replies)
Discussion started by: rahul2662
7 Replies

2. AIX

IHS connector related loading issue

I am getting the following error on loading the connector DLL in IHS 8.5 on AIX 7.1 bash-4.2# /usr/32bit/IBM/HTTPServer/bin/apachectl start httpd: Syntax error on line 902 of /usr/32bit/IBM/HTTPServer/conf/httpd.conf: Cannot load /usr/<company_name>/IHS85/lib/libApache22Connector.a into... (3 Replies)
Discussion started by: George47
3 Replies

3. UNIX for Advanced & Expert Users

Unix terminal display related issue

Want few input related to unix environment and terminal settings: 1. Am trying to find a way to keep the unix terminal display intact even after opening and closing a vi/less file. Currently if I open a vim file in the unix terminal and then close the file,it displays the contents of vim file on... (4 Replies)
Discussion started by: talktovkjain
4 Replies

4. Shell Programming and Scripting

need downloading related help...but its not related to unix

Hi All, I am trying to dowmload the zip file "zkManageCustomers.zip " but i dont have access. Can anyone help me to download this file See the below link- http://www.ibm.com/developerworks/opensource/library/wa-aj-open/index.html?ca=drs- Please help me as early as... (1 Reply)
Discussion started by: aish11
1 Replies

5. Shell Programming and Scripting

Date related issue

Hi, I have TDATE=$(date '+%b %d') That stores "Sep 01" in the TDATE. How I can store "Sep 1"? Thanks in advance (3 Replies)
Discussion started by: dipeshvshah
3 Replies

6. Programming

Issue Related to Splash Screen in Java

Hi all, Actually I want to flash the image which I have in my system and when I am trying to do it,it is not showing it.simply creates the frame but not displaying the image.I am attaching the code-- Please take a look on it and please provide your valuable suggestions on it so that I... (2 Replies)
Discussion started by: smartgupta
2 Replies

7. Programming

Issue Related to Proxy Server

Hi All, I am establishing the proxy server to communicate the date between devices using serial port but after serial port connection,it should start the Proxy Server and still run till the communication is happening...but server became started but it became halted due to error - Please... (1 Reply)
Discussion started by: smartgupta
1 Replies

8. Programming

Issue Related to Splash Screen

Hi Guys, I am working with Solaris 9 and we are developing the application which will work on different OS.So we develop the GUI using JAVA swings... we want to display a Splash screen before starting the installation of the application... 1st we develop our application for windows and it is... (1 Reply)
Discussion started by: smartgupta
1 Replies

9. Programming

Issue related to native method

Hi, I am working with java and C/C++.In my java code I am using the native method to work with C/C++.So I am getting some error in C/C++ source code which I am not able to find it because It is throwing the only java null Exception.... Is there any way by which I can see the error in java console... (0 Replies)
Discussion started by: smartgupta
0 Replies

10. HP-UX

Facing an issue related to cronjob

Dear All, I am facing an issue related to cronjob and explained below is the case study: 1. I have a java class named "DmCheckRenditionQueue.java" and placed under "/cpc/documentum/product/5.2.5/tomcat/webapps/rendition" 2. When I am using the command "/usr/openv/java/jre/bin/java -cp... (1 Reply)
Discussion started by: parindam
1 Replies
Login or Register to Ask a Question