Latest Tutorials| Questions and Answers|Ask Questions?|Site Map



Home Answers Viewqa Date-Calendar LINUX SHELL SCRIPT
Login         

View Questions and Answers by Category

Advertisements


 
Have Programming Question? Ask it here!
 
 
 


morris
LINUX SHELL SCRIPT
0 Answer(s)      4 years and 5 months ago
Posted in : Date-Calendar



I wish to create a bash shell script that meets the requirements below.
?Write a bash shell script called how_many_to_go that calculates and prints the number of days, hours, minutes and/or seconds until the end of the current month (based on the output of the date command).
o Do not make any assumptions about what month it is - the script should run properly in any month.
o Assume that it is not a leap year, so the number of days in any month is known (February has 28 days; April, June, September, and November have 30 days; All the rest have 31 days).
o The output should read "There are d days, h hours, m minutes, and s seconds until the end of the month" except as modified by the command line arguments below.
o The script should accept command line arguments as follows (assume that it's now 11:00:00 PM on January 30):
how_many_to_go - print the number of days, hours, minutes, and seconds until the end of the month (e.g. "There are 1 days, 1 hours, 0 minutes, and 0 seconds until the end of the month")
how_many_to_go h - print the number of hours, minutes, and seconds until the end of the month (e.g. "There are 25 hours, 0 minutes, and 0 seconds until the end of the month")
 how_many_to_go m - print the number of minutes and seconds until the end of the month (e.g. "There are 1500 minutes and 0 seconds until the end of the month")
 how_many_to_go s - print the number of seconds until the end of the month (e.g. "There are 90000 seconds until the end of the month.

Thanks

Advertisement
View Answers

Related Tutorials/Questions & Answers:
LINUX SHELL SCRIPT - Date Calendar
LINUX SHELL SCRIPT   I wish to create a bash shell script that meets the requirements below. ?Write a bash shell script called how_many_to_go... not make any assumptions about what month it is - the script should run properly
Export to Shell Script Plugin
Export to Shell Script Plugin   ... having to custom write the shell script code For more information click... of an eclipse project's runtime configurations to shell scripts in various formats
Advertisements
how to execute a unix shell script from a java program
how to execute a unix shell script from a java program  well , i am... the script name from a java code .once you execute this java program ultimately your script gets executed.. it would be a lot of help to me
Linux
Linux  hi all, i want to invoke shell program from java. i m using the following code. package script; import java.io.IOException; public class RunShell { public static void main(String[] args) throws IOException
Wicked Shell
Wicked Shell Wicked Shellis an Eclipse plugin providing direct access to your system's shell. To be honest, Wicked Shell is not evil at all, although it calls itself wicked... Wicked Shell is a small plugin trying to support your
windows shell scripting
windows shell scripting   Hi All, Using this knowledge make a batch file to achieve the following when the batch file is executed. Accept three parameters, a. Param1 b. Param2 c. Param3 Display the accepted parameters
windows shell scripting
windows shell scripting   Hi All, Using this knowledge make a batch file to achieve the following when the batch file is executed. Accept three parameters, a. Param1 b. Param2 c. Param3 Display the accepted parameters
Sitemap Linux Tutorial
to Shut down Linux | Shell in Linux. | Shell Programming. | Securities in Linux... | Site Map | Business Software Services India Linux Tutorial Section What is Linux? | Introducing Linux OS | Beginner Guide to Linux Server
Linux Administrator
with routers (Cisco preferably)  Knowledge of UNIX /Linux shell... Linux Administrator       Position Vacant: Linux Administrator Job Description 
java server on linux ystems
java server on linux ystems  hi.. i use linux... i want to remotely login into another linux system using java and then execute commands over... for exmple in shell we use "ssh username@ipaddress" to login to a host...how can i login
Linux installation
Linux installation  I want to install linux for generally purpose functions,which linux[fedora , ubunto,centos etc ]should i install.In my pc there is already windows,How much the linux will effect my windows & data in C
LINUX - Regex
LINUX  I am running Radhat LINUX in my system.. but in this gcc/cc/g++ command is not working .. so i think C,C++ is not installed my system... to the LINUX . I know for window.. but i want to connect LINUX
jdbc in linux
jdbc in linux  what will be database url if i'm using mysql database on linux platform ? what will be driver name & class name to be used in "Class.forName()" method ? plz give short source code
Linux Programming
Linux Programming  1.Write a program that reads an integer by the user and displays it in octal (base 8): Enter an integer number between 0 and 32767: 2012 In octal, your number is: 3734 (Use the same input and output format
Linux Simulator. - WebSevices
Linux Simulator.  What is Linux simulator  try cygwin for this you can run linux commands and almost all in cygwin
VoIP Linux
VoIP Linux Linux Online -VoIP This document explains about VoIP... lines of VoIP architecture. Linux is available in several formats, called..., and other useful information.      VoIP Linux
Java Script
Java Script  why we are using java script
Java script
Java script  Source code for capturing the screen using Java Script
php editor in linux
php editor in linux  Which editor works in Linux for PHP
java on linux - Java Beginners
java on linux  How to compile and execute java applications in linux
Java Programming on Linux
on Linux? I want following tutorials: a) installing and enabling a Java runtime environment on Linux b) Java development on Linux to run Java applications c) Running applets under Linux d) How to install Tomcat on linux? e) How to use Sun
Linux Vs. Windows
prompt, whereas in Linux it is known as Shell. The DOS prompt for  each... supports all versions of Linux, but it usually uses one called BASH (Bourne Again Shell... Linux Vs. Windows       
script for data
script for data  how to write a simple script to display a selected data from list in flex applicatin?.   Hi Friend, Please visit the following link: Flex Application Thanks
Java Script
Java Script  Hi, Any one please share a code to swap the 2strings using java script
Java Script
Java Script  What is Java Script? How to learn Java Script?   Hi Java Script is client side programming language. It runs on browser.... You can learn Java Script from our JavaScript - JavaScript Tutorial pages
What is Linux Hosting?
Linux is an operating system that is developed and licensed as open source software that can be accessed by any web developer and services. Linux... and cloud services. Presently along with Windows hosting services Linux hosting
Window Script
Window Script  i want to write windows script can you help me in writing those i want to write script so that it follows below steps Step 1) downloading file from FTP 2) Unzip it 3) Edit it 4) zip it 5) upload again to FTP
java script
java script  Hi, Any one please tell me how, to store below elements in an array using java script 12,13,14,a,b,xyz
Java script
Java script  a java script code for accept 10 numbers from the user and print in the descending order without using sort method
java script
java script  how to write a Java script program to enter number in two text fields and then automatically display the total in another text field
Java Script.
Java Script.  Hi Sir, The below java script code is not working in Google chrome can yo give me the solution as soon as possible. <script type="text/javascript"> function setValue(){ var val=""; var frm
 

 

 

DMCA.com