getting date from shell and pass it to java


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting getting date from shell and pass it to java
# 1  
Old 03-17-2008
getting date from shell and pass it to java

Hi,

I have a variable called asOfDate in shell script.
I need to pass it as a command line argument to a java command which will be called from the same shell script.
The format of that variable is "MM/DD/YYYY"

while doing echo, it is printing correctly in the java command.
ie. asOfDate="03/13/2008".

But inside the java program, it says an exception - parse error.

If we are running the java command in the command prompt by giving the asOfDate="03/13/2008" , it is running fine. Something wrong in the date given by the script.

Please advice. Thanks in advance.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

Pass RegEx to java program in bash script

I can't seem to get this right. I've tried it every way imaginable using every trick I see on stackexchange and such. No luck. So nothing major here, something like: #!/bin/bash SEARCH="ARG1 ARG2 '((^EXACT$)|(.*InTheMiddle*)|(^AtBeginning*))'" java -cp /my/class/path MyClassName $SEARCH... (3 Replies)
Discussion started by: stonkers
3 Replies

2. Shell Programming and Scripting

Pass C shell array to another C shell script(csh) and shell(sh)

Dear Friends, Please help me on this my script name is send.csh In this i have written the statement like this set args = ( city state country price ) I want to pass this array to another c shell called receiver.csh. and i want to use it in this c shell or how to pass to... (2 Replies)
Discussion started by: SA_Palani
2 Replies

3. Shell Programming and Scripting

How to pass the environment name while calling java program from unix script?

Hi, I'm trying to test one unix shell script in dev environment. But I'm not sure how to pass the environment in my java program calling code. I'm trying to use -DconsumerEnv="DEV" but unfortunately I get 'null' while trying to print the value from java class. System.out.println("Environment: "+... (4 Replies)
Discussion started by: Pramit
4 Replies

4. Programming

date change shell script in java code

hi, I have a code to connect to a remote Linux server through windows using SSH, with host-name, username and password built in the code. I want to add a shell script in the code which should execute automatically without any user intervention. (as u know that date change requires you/us to be... (0 Replies)
Discussion started by: tarkan
0 Replies

5. Shell Programming and Scripting

Call java program from shell and pass values

Hi All, Can anybody please help me with how can i call my java program from shell and also pass parameter along with it so that the program can interpret the value/int and update the database. Thanks in advance Neha (1 Reply)
Discussion started by: Neha Goyal
1 Replies

6. Shell Programming and Scripting

Pass the first date and last date of previous month

Hi All, I need to run a job every month at the beginning of the month which is scheduled through autosys, lets say on 03/01/2010. I need to pass the last month's i.e February's first_date = 02/01/2010 and last_date = 02/28/2010 as variables to a stored procedure. Can somebody please pass... (2 Replies)
Discussion started by: vigdmab
2 Replies

7. Shell Programming and Scripting

How to pass a date read from database to the shell script?

Hi i have a database table which i will query in a sqlplus session and it will either come back with a date or null? Now, what i want to do is based on the date returned i will either abort or continue with the script execution. I need to know is there a way other than spooling the date... (4 Replies)
Discussion started by: vinoo128
4 Replies

8. Shell Programming and Scripting

Pass string from shell script to java

Hi, I,m writing a program in shell script and currently this script is calling a java program. I have a problem to pass string variable from my shell script to the java program. I don't know on how to pass it and how the java program can call what I have pass from the shell script. This is... (3 Replies)
Discussion started by: badbunny9316
3 Replies

9. Programming

Re : Pass parameters from Cron job to Java code

Hello All, Hope all is fine. I am newbie to Unix. I am using Bourne Shell (sh). One of the question I have is that I am trying to read XML file and based on reading that XML file I want to run same java programs at different hours. When I run the Java code, I wanted to pass parameters to my... (1 Reply)
Discussion started by: samshaw
1 Replies

10. Shell Programming and Scripting

How to pass stdin to java?

I have a java program that uses jtidy to read from stdin and write to stdout. I want to use this with vi or vim. The problem is that the java class paths are pretty ugly. How do I write a bash script that looks like this: ./jtidy.sh <inputfile.html >outputfile.html and has the same effect... (0 Replies)
Discussion started by: siegfried
0 Replies
Login or Register to Ask a Question
AIRPORT2-PORTINSPECTOR(1)				      General Commands Manual					 AIRPORT2-PORTINSPECTOR(1)

NAME
airport2-portinspector - Port maps inspector for the Apple AirPort Extreme Base Station ("Snow") SYNOPSIS
airport2-portinspector DESCRIPTION
airport2-portinspector allows you to inspect the port maps used by the hosts associated with your base station. OPTIONS
airport2-portinspector accepts no command-line options. airport2-portinspector is a wrapper script around the PortInspector.jar jar file located in /usr/share/java/airport-utils. You can set the JAVACMD environment variable to use a specific JVM instead of the one chosen by the wrapper script. Set the DEBUG environ- ment variable to 1 to get the debug output from the wrapper script. ENVIRONMENT VARIABLES
DEBUG Set this variable to 1 to get the debug output from the wrapper script. JAVACMD The full path to the Java Virtual Machine to use. By default, the wrapper uses JAVACMD; if it is not set, it looks for JAVA_BINDIR/java, then for JAVA_HOME/bin/java before looking for a java executable in the PATH. In the latter case, the JVM used can be configured using the Debian alternatives system (see update-alternatives(8)). JAVA_HOME The full path where your JDK/JRE is installed. JAVA_BINDIR The full path to the directory where the java executable is located. JAVA_ARGS Extra command-line arguments to be passed to the Java Virtual Machine. AUTHOR
airport2-portinspector was written by Jon Sevy <jsevy@cs.drexel.edu>. This manual page was written by Julien BLACHE <jblache@debian.org>, for the Debian project (but may be used by others). May 20, 2006 AIRPORT2-PORTINSPECTOR(1)