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 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
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
How do I read a variable from a file in shell script
command. How do I read a variable from a file in shell script and then use...How do I read a variable from a file in shell script  Hi, In my project we are submitting the job on spark cluster through sh file. Now I want
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
Sitemap Linux Tutorial
| How to Shut down Linux | Shell in Linux. | Shell Programming... | Site Map | Business Software Services India Linux Tutorial Section What is Linux? | Introducing Linux OS | Beginner Guide to Linux Server
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
ModuleNotFoundError: No module named 'shell'
ModuleNotFoundError: No module named 'shell'  Hi, My Python program is throwing following error: ModuleNotFoundError: No module named 'shell' How to remove the ModuleNotFoundError: No module named 'shell'
ModuleNotFoundError: No module named 'to-shell'
ModuleNotFoundError: No module named 'to-shell'  Hi, My Python... 'to-shell' How to remove the ModuleNotFoundError: No module named 'to-shell... to install padas library. You can install to-shell python with following
Linux Administrator
Linux Administrator       Position Vacant: Linux Administrator Job Description  We are looking for Linux Administrator to manage Linux and Unix servers
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
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
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
importing pyspark in python shell
is that its not coming in the python shell. How should I do for importing pyspark in python shell? I am experience Python developer and now looking to use my
importing pyspark in python shell
is that its not coming in the python shell. How should I do for importing pyspark in python shell? I am experience Python developer and now looking to use my
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
Java script
Java script  Source code for capturing the screen using Java Script
Java Script
Java Script  why we are using java script
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
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
ModuleNotFoundError: No module named 'ansible-shell'
ModuleNotFoundError: No module named 'ansible-shell'  Hi, My... 'ansible-shell' How to remove the ModuleNotFoundError: No module named 'ansible-shell' error? Thanks   Hi, In your python
ModuleNotFoundError: No module named 'ansible-shell'
ModuleNotFoundError: No module named 'ansible-shell'  Hi, My... 'ansible-shell' How to remove the ModuleNotFoundError: No module named 'ansible-shell' error? Thanks   Hi, In your python
ModuleNotFoundError: No module named 'ansible-shell'
ModuleNotFoundError: No module named 'ansible-shell'  Hi, My... 'ansible-shell' How to remove the ModuleNotFoundError: No module named 'ansible-shell' error? Thanks   Hi, In your python
ModuleNotFoundError: No module named 'ansible-shell'
ModuleNotFoundError: No module named 'ansible-shell'  Hi, My... 'ansible-shell' How to remove the ModuleNotFoundError: No module named 'ansible-shell' error? Thanks   Hi, In your python
ModuleNotFoundError: No module named 'aws-shell'
ModuleNotFoundError: No module named 'aws-shell'  Hi, My Python... 'aws-shell' How to remove the ModuleNotFoundError: No module named 'aws-shell' error? Thanks   Hi, In your python environment you
ModuleNotFoundError: No module named 'click-shell'
ModuleNotFoundError: No module named 'click-shell'  Hi, My Python... 'click-shell' How to remove the ModuleNotFoundError: No module named 'click-shell' error? Thanks   Hi, In your python environment
ModuleNotFoundError: No module named 'clik-shell'
ModuleNotFoundError: No module named 'clik-shell'  Hi, My Python... 'clik-shell' How to remove the ModuleNotFoundError: No module named 'clik-shell' error? Thanks   Hi, In your python environment you
ModuleNotFoundError: No module named 'curricula-shell'
ModuleNotFoundError: No module named 'curricula-shell'  Hi, My... named 'curricula-shell' How to remove the ModuleNotFoundError: No module named 'curricula-shell' error? Thanks   Hi, In your python
ModuleNotFoundError: No module named 'hyper-shell'
ModuleNotFoundError: No module named 'hyper-shell'  Hi, My Python... 'hyper-shell' How to remove the ModuleNotFoundError: No module named 'hyper-shell' error? Thanks   Hi, In your python environment
ModuleNotFoundError: No module named 'irods-shell'
ModuleNotFoundError: No module named 'irods-shell'  Hi, My Python... 'irods-shell' How to remove the ModuleNotFoundError: No module named 'irods-shell' error? Thanks   Hi, In your python environment
ModuleNotFoundError: No module named 'irods-shell'
ModuleNotFoundError: No module named 'irods-shell'  Hi, My Python... 'irods-shell' How to remove the ModuleNotFoundError: No module named 'irods-shell' error? Thanks   Hi, In your python environment
ModuleNotFoundError: No module named 'kore-shell'
ModuleNotFoundError: No module named 'kore-shell'  Hi, My Python... 'kore-shell' How to remove the ModuleNotFoundError: No module named 'kore-shell' error? Thanks   Hi, In your python environment you
ModuleNotFoundError: No module named 'kube-shell'
ModuleNotFoundError: No module named 'kube-shell'  Hi, My Python... 'kube-shell' How to remove the ModuleNotFoundError: No module named 'kube-shell' error? Thanks   Hi, In your python environment you
ModuleNotFoundError: No module named 'lg-shell'
ModuleNotFoundError: No module named 'lg-shell'  Hi, My Python...-shell' How to remove the ModuleNotFoundError: No module named 'lg-shell... to install padas library. You can install lg-shell python with following
ModuleNotFoundError: No module named 'lg-shell'
ModuleNotFoundError: No module named 'lg-shell'  Hi, My Python...-shell' How to remove the ModuleNotFoundError: No module named 'lg-shell... to install padas library. You can install lg-shell python with following
ModuleNotFoundError: No module named 'marcopolo-shell'
ModuleNotFoundError: No module named 'marcopolo-shell'  Hi, My... named 'marcopolo-shell' How to remove the ModuleNotFoundError: No module named 'marcopolo-shell' error? Thanks   Hi, In your python
ModuleNotFoundError: No module named 'marcopolo-shell'
ModuleNotFoundError: No module named 'marcopolo-shell'  Hi, My... named 'marcopolo-shell' How to remove the ModuleNotFoundError: No module named 'marcopolo-shell' error? Thanks   Hi, In your python
ModuleNotFoundError: No module named 'ma-shell'
ModuleNotFoundError: No module named 'ma-shell'  Hi, My Python...-shell' How to remove the ModuleNotFoundError: No module named 'ma-shell... to install padas library. You can install ma-shell python with following
ModuleNotFoundError: No module named 'odoo8-addon-shell'
ModuleNotFoundError: No module named 'odoo8-addon-shell'  Hi, My... named 'odoo8-addon-shell' How to remove the ModuleNotFoundError: No module named 'odoo8-addon-shell' error? Thanks   Hi, In your
ModuleNotFoundError: No module named 'os-shell'
ModuleNotFoundError: No module named 'os-shell'  Hi, My Python...-shell' How to remove the ModuleNotFoundError: No module named 'os-shell... to install padas library. You can install os-shell python with following
ModuleNotFoundError: No module named 'ovirt-shell'
ModuleNotFoundError: No module named 'ovirt-shell'  Hi, My Python... 'ovirt-shell' How to remove the ModuleNotFoundError: No module named 'ovirt-shell' error? Thanks   Hi, In your python environment
ModuleNotFoundError: No module named 'ovirt-shell'
ModuleNotFoundError: No module named 'ovirt-shell'  Hi, My Python... 'ovirt-shell' How to remove the ModuleNotFoundError: No module named 'ovirt-shell' error? Thanks   Hi, In your python environment
ModuleNotFoundError: No module named 'pilot-shell'
ModuleNotFoundError: No module named 'pilot-shell'  Hi, My Python... 'pilot-shell' How to remove the ModuleNotFoundError: No module named 'pilot-shell' error? Thanks   Hi, In your python environment
ModuleNotFoundError: No module named 'powerline-shell'
ModuleNotFoundError: No module named 'powerline-shell'  Hi, My... named 'powerline-shell' How to remove the ModuleNotFoundError: No module named 'powerline-shell' error? Thanks   Hi, In your python
ModuleNotFoundError: No module named 'py3-rest-shell'
ModuleNotFoundError: No module named 'py3-rest-shell'  Hi, My... named 'py3-rest-shell' How to remove the ModuleNotFoundError: No module named 'py3-rest-shell' error? Thanks   Hi, In your python
ModuleNotFoundError: No module named 'py3-rest-shell'
ModuleNotFoundError: No module named 'py3-rest-shell'  Hi, My... named 'py3-rest-shell' How to remove the ModuleNotFoundError: No module named 'py3-rest-shell' error? Thanks   Hi, In your python
ModuleNotFoundError: No module named 'py3-rest-shell'
ModuleNotFoundError: No module named 'py3-rest-shell'  Hi, My... named 'py3-rest-shell' How to remove the ModuleNotFoundError: No module named 'py3-rest-shell' error? Thanks   Hi, In your python
ModuleNotFoundError: No module named 'pygtk-shell'
ModuleNotFoundError: No module named 'pygtk-shell'  Hi, My Python... 'pygtk-shell' How to remove the ModuleNotFoundError: No module named 'pygtk-shell' error? Thanks   Hi, In your python environment