Shell script time output over java environment -


i running script java program using sshxcute api. script contains:

 #!/bin/sh data=`stat -c%y filename` echo $data 

script running on bash gives output:

2014-03-08 13:26:29.335545828 -0800 

script running through java program gives output:

2014-03-08 21:26:29.335545828 +0000 

i think -0800 getting added. need output in first format. how resolve issue?

i tried , worked fine me. maybe have problems getting stat of wrong file.

ex.sh

filename=$1 data=`stat -c%y $filename` echo $data 

when run sh ex.sh x.log console, here get:

 2014-03-11 16:56:21.000000000 +0200 

i tried same thing ganymed ssh api , same result.

2014-03-11 16:56:21.000000000 +0200 

Comments

Popular posts from this blog

get url and add instance to a model with prefilled foreign key :django admin -

android - Keyboard hides my half of edit-text and button below it even in scroll view -

css - Make div keyboard-scrollable in jQuery Mobile? -