Link to home
Create AccountLog in
Avatar of leelakiran
leelakiran

asked on

Need hlep in shell scripting

Hi,

   I need small help to capturing the start time and writing to a text(.txt) file and reading the that time in the html page. How can i achieve this. I need to implement this logic in the below script.

# run the job test_start.sh
#!/bin/ksh
sh /DWH/maintenance/test_start.sh
if [[ $? -ne 0 ]];
then
echo "Exit the process due to failure of the job: test_start.sh"
exit 1
fi
sleep 120
sh /DWH/maintenance/test_end.sh
exit 0

Thanks in advance
Avatar of woolmilkporc
woolmilkporc
Flag of Germany image

Hi,

do you mean something like this:

date > text.txt

or maybe

echo "Start time of $0 is $(date)" > text.txt

or did I get you wrong?

wmp
Not sure exactly what you want, to capture the start time and put it into a text file
date > /tmp/time.txt
You can format the date with the % options

Don't understand what you mean by read time in html page... Do you want the txt file to be converted into a html file?  Ir would creating a simple html page with the start date in it be OK?  Something like
echo \<html\> \<head\>  \</head\> \<body\> >/tmp/date.htm
date >> /tmp/date.htm
echo \</body\> \</html\> >> /tmp/date.htm
Avatar of leelakiran
leelakiran

ASKER

Hi,

  Sorry for the confusion. Actually the requirement is we have .txt file in  that file, content is "“Application down 9.00AM to 09.30 AM CST". Each time once the above shell script is run we need the copy this .txt file content into html file and the html file name will be "maintenance.html" ( this .html file location is /opt/bin/websphere/en_us/maintenance.html).

can anybody help to implement this in the script.

Thanks in adavance
ASKER CERTIFIED SOLUTION
Avatar of liddler
liddler
Flag of Ireland image

Link to home
membership
Create an account to see this answer
Signing up is free. No credit card required.
Create Account