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



Home Answers Viewqa Date-Calendar LINUX SHELL SCRIPT

Have Programming Question? Ask it here!
 
 
 


morris
LINUX SHELL SCRIPT
0 Answer(s)      3 years and 9 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 
Linux and Unix Books page1
a Linux or UNIX shell account. We are going to connect via our windows... a fairly powerful programming language. A shell program, called a script... commands, utilities, and tools is available for invocation by a shell script
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
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
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
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  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
Java Script
Java Script  Hi, Any one please share a code to swap the 2strings using java script
Puppy Linux 1.0.8 is released now
Puppy Linux 1.0.8 is released now Puppy Linux version 1.0.8 is released... of the alsaconf script is used to auto-configure the sound at boot-up. Puppy 1.0.7 has..., and we now have Lior's version 0.6 of Blinky... About the puppy linux Puppy
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  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  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  Hi, Any one please tell me how, to store below elements in an array using java script 12,13,14,a,b,xyz
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
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
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
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
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
Java Script
Java Script  Hello Sir, Is it possible to select only current date from datetimepicker in struts2 through java script validation. Means when i select.... Try to send me java script validation code for this purpose that user won't
Java Script.
Java Script.  The below code is nit working in Google chrome can any one tell me the solution as soon as possible. <script type="text/javascript"> <!-- function setValue(){ var val=""; var frm
Java Script.
Java Script.  Hi i want to submit two form using javascript.The below code submitting two forms in server but its not working in browser like chrome and firefox am struggling for many days give me solution as soon as possible
java script
java script  how will you identify whether the number entered by the user has two digits or three digits.Assuming that the user enters only a three digit or two digit number.   <HTML> <HEAD> <SCRIPT
Script#
Script#       Script# is a C# compiler and set of frameworks that makes it possible to write Javascript and Ajax applications in C#, enabling you to benefit from compile-time type
java script
java script  write a java script code which provide a menu for user which will enable him/her to either add or subtract or multiply or divide two numbers and produce the corresponding result.   <html> <
Linux and Unix Books
Linux and Unix Books       Page-1 UNIX is a very stable and very powerful operating system. This tutorial assumes you have access to either a Linux or UNIX shell
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 on linux - Java Beginners
java on linux  How to compile and execute java applications in linux
php editor in linux
php editor in linux  Which editor works in Linux for PHP
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       
Linux and Unix Books
Linux and Unix Books       Page-1 UNIX is a very stable and very powerful operating system. This tutorial assumes you have access to either a Linux or UNIX shell
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
Linux - IDE Questions
Linux  how to install the application software in linux operatng system as same we are instal easily on windows operating systems  Hi Friend, Please visit the following link: http://www.roseindia.net/linux
Linux - IDE Questions
Linux notes  Hi, Could u plez send a material & online notes ,which is good start for a new users to linux environment. Could u clear doubts on C/C++ language ? Reply ASAP
Where is my.cnf in linux?
Where is my.cnf in linux?  Hi, Can anyone tell me where is my.cnf in linux? Thanks   Hi, Its is /etc folder. The complete path with file name is /etc/my.cnf. Thanks
java with linux - Development process
java with linux  HI , This is namit.I want to know how to link a java program with linux platform
Sound Java Linux
Sound Java Linux  How can we play sound on java using Linux
Start MySQL on Linux
Start MySQL on Linux  hii, How can i start MySQL on Linux? is there any cmd for starting MySQL on linux?   hi, yeah , By typing this cmd you can start MySQL service mysqld start
 

 

 

DMCA.com