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
serialver(1)						      General Commands Manual						      serialver(1)

NAME
serialver - serial version command SYNOPSIS
serialver [ options ] [ classnames ] options Command-line options, as specified in this document. classnames One or more class names. DESCRIPTION
serialver returns the serialVersionUID for one or more classes in a form suitable for copying into an evolving class. When invoked with no arguments, it prints a usage line. OPTIONS
-classpath <directories and zip/jar files separated by:> Set search path for application classes and resources. -show Displays a simple user interface. Enter the full class name and press either the Enter key or the Show button to display the serialVersionUID. -Joption Pass option to the Java virtual machine, where option is one of the options described on the man page for the java applica- tion launcher, java(1). For example, -J-Xms48m sets the startup memory to 48 megabytes. It is a common convention for -J to pass options to the underlying virtual machine. SEE ALSO
See (or search java.sun.com) for the following: java.io.ObjectStreamClass @ http://java.sun.com/j2se/1.5/docs/api/java/io/ObjectStreamClass.html 24 June 2004 serialver(1)