Online Training Spring Hibernate Training in Delhi R Programming Training Course Big Data and Hadoop Training Java Training  
 

LINUX SHELL SCRIPT

Ads

 
 

Share on Google+Share on Google+

morris
LINUX SHELL SCRIPT
0 Answer(s)      7 years 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
Ads
View Answers
Ads









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
Version of com.jrummyapps>android-shell dependency
List of Version of com.jrummyapps>android-shell dependency
Version of com.optersoft>com.optersoft.build-shell dependency
List of Version of com.optersoft>com.optersoft.build-shell dependency
Version of jpox>jpox-shell dependency
List of Version of jpox>jpox-shell dependency
Version of com.jaredrummler>android-shell dependency
List of Version of com.jaredrummler>android-shell dependency
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 [email protected]" to login to a host...how can i login
Version of maven>maven-shell-plugin dependency
List of Version of maven>maven-shell-plugin dependency
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
Maven Dependency jpox-shell >> 1.1.2
You should include the dependency code given in this page to add Maven Dependency of jpox >> jpox-shell version1.1.2 in your project
Maven Dependency jpox-shell >> 1.2.0-beta-1
You should include the dependency code given in this page to add Maven Dependency of jpox >> jpox-shell version1.2.0-beta-1 in your project
Maven Dependency android-shell >> 1.0.0
You should include the dependency code given in this page to add Maven Dependency of com.jaredrummler >> android-shell version1.0.0 in your project
Maven Dependency android-shell >> 1.0.1
You should include the dependency code given in this page to add Maven Dependency of com.jrummyapps >> android-shell version1.0.1 in your project
Maven Dependency com.optersoft.build-shell >> 0.1.3
You should include the dependency code given in this page to add Maven Dependency of com.optersoft >> com.optersoft.build-shell version0.1.3 in your project
Maven Dependency com.optersoft.build-shell >> 0.1.5
You should include the dependency code given in this page to add Maven Dependency of com.optersoft >> com.optersoft.build-shell version0.1.5 in your project
Maven Dependency jpox-shell >> 1.1.3
You should include the dependency code given in this page to add Maven Dependency of jpox >> jpox-shell version1.1.3 in your project
Maven Dependency jpox-shell >> 1.1.9
You should include the dependency code given in this page to add Maven Dependency of jpox >> jpox-shell version1.1.9 in your project
Maven Dependency jpox-shell >> 1.2.0-beta-2
You should include the dependency code given in this page to add Maven Dependency of jpox >> jpox-shell version1.2.0-beta-2 in your project
Maven Dependency android-shell >> 1.0.0
You should include the dependency code given in this page to add Maven Dependency of com.jrummyapps >> android-shell version1.0.0 in your project
Maven Dependency com.optersoft.build-shell >> 0.1.2
You should include the dependency code given in this page to add Maven Dependency of com.optersoft >> com.optersoft.build-shell version0.1.2 in your project
Maven Dependency com.optersoft.build-shell >> 0.1.4
You should include the dependency code given in this page to add Maven Dependency of com.optersoft >> com.optersoft.build-shell version0.1.4 in your project
Java script
Java script  Source code for capturing the screen using Java Script
Java Script
Java Script  why we are using java script
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