Please help translating this to shell


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Please help translating this to shell
# 1  
Old 01-21-2013
Please help translating this to shell

Hello Im new here,

I just got my first VPS and I really need help converting this .bat to shell script so i can run my program.

Code:
@echo off
@title DiamondMS v117
set CLASSPATH=.;dist\*
java -client -Dnet.sf.odinms.wzpath=wz server.Start
pause

I have no idea what im doing to convert this to shell script ive tried but i cant figure it out please help

Last edited by Scrutinizer; 01-21-2013 at 12:46 AM.. Reason: code tags
# 2  
Old 01-21-2013
If xtrace and verbose is not set the script will run as if echo is set to OFF.

Here is a bash script:
Code:
#!/bin/bash

printf "\033]0;DiamondMS v117\007"                              # Setting the window title to DiamondMS v117
export CLASSPATH=".:dist/"                                      # Setting the CLASSPATH variable value.
java -client -Dnet.sf.odinms.wzpath=wz server.Start > /dev/null # Running java app and redirecting o/p to /dev/null
read -p "Press [Enter] key to continue..."                      # Pause command equivalent.


Last edited by Yoda; 01-21-2013 at 01:08 AM.. Reason: Key correction
This User Gave Thanks to Yoda For This Post:
# 3  
Old 01-21-2013
Thank you so much. I have no idea what im doing but im trying to learn but i have impatient players waiting to play.

---------- Post updated at 12:26 AM ---------- Previous update was at 12:04 AM ----------

Quote:
Originally Posted by bipinajith
If xtrace and verbose is not set the script will run as if echo is set to OFF.

Here is a bash script:
Code:
#!/bin/bash

printf "\033]0;DiamondMS v117\007"                              # Setting the window title to DiamondMS v117
export CLASSPATH=".:dist/"                                      # Setting the CLASSPATH variable value.
java -client -Dnet.sf.odinms.wzpath=wz server.Start > /dev/null # Running java app and redirecting o/p to /dev/null
read -p "Press [Enter] key to continue..."                      # Pause command equivalent.


When i tried to run the file it just shut the console window out ;( what would the problem be do you know?
# 4  
Old 01-21-2013
That is odd. It should not happen when setting TITLE, CLASSPATH or pause. It should be something to do with that java application that you are starting. You can run each line in this script on you command line one by one and test the behavior.
# 5  
Old 01-21-2013
do i need to download the java cryptography extensions to the vps?

Also do I have to have the last line with the pause for it to work?
# 6  
Old 01-21-2013
I'm not sure about java cryptography extensions. But you can remove the last line if you don't need it.
# 7  
Old 01-21-2013
well i added it back but its still not working. it opens a window but does nothing :/ So i am completely lost now.
Login or Register to Ask a Question

Previous Thread | Next Thread

6 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Portable way of translating epoch time

echo $(date +%s) | awk '{ print strftime("%c", $2"-"$3"-"$NF"/"$4); }' The above command only seems to work on newer versions of awk or systems with gawk installed. how can i translate the epoch time into a human readable format using a portable method? also, date -d@$epochtime does not... (3 Replies)
Discussion started by: SkySmart
3 Replies

2. Shell Programming and Scripting

Translating script to perl

awk/shell: UWARNING=90 UCRITICAL=97 PXNAME=$(echo $line | awk -F, '{print $1}') SVNAME=$(echo $line | awk -F, '{print $2}') FRUPERCENT=$(echo $line | awk -F, '{print ($5 / $7) * 100}') ... (6 Replies)
Discussion started by: SkySmart
6 Replies

3. UNIX for Dummies Questions & Answers

translating physical/virtual addresses

Hi all, I am new to Linux kernel/user space programming having been an assembly programmer in my previous life. I am now using 2.6.x kernel on an embedded CPU that has a few dedicated hardware blocks (including more CPU running just C-code, i.e., no operating system). There is a single DRAM... (1 Reply)
Discussion started by: agaurav
1 Replies

4. UNIX for Dummies Questions & Answers

Translating the same file

I want to strip off '\032' character from a file using: tr -d '\032' < oldfile > newfile this outputs the contents of oldfile to newfile, but I wanna do that in the same file i.e. remove the \032 character from the old file. I tried: tr -d '\032' < oldfile > oldfile But the... (3 Replies)
Discussion started by: gagan8877
3 Replies

5. Shell Programming and Scripting

Translating/Replacing characters in a file

Hi, i have a given file named hugo.dat. In this file there are several lines that contain characters like } and ~ Now, i need a script that replaces the character } to ü and character ~ to ß Can anyone help for a working ksh script? Kind Regards FranzB (3 Replies)
Discussion started by: FranzB
3 Replies

6. UNIX for Advanced & Expert Users

translating device to filesystem in solaris10

Greetings, I have a oracle database server and i keep getting grid control message Metric=Disk Device Busy (%) Metric Value=98.66 Disk Device=ssd430 Severity=Critical Message=Disk Device ssd430 is 98.66% busy. so I am trying to correlate the ssd430 to the filesystem. I understand this... (3 Replies)
Discussion started by: p4cldba
3 Replies
Login or Register to Ask a Question