My script is working but why do I get this msg?


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting My script is working but why do I get this msg?
# 1  
Old 11-29-2010
My script is working but why do I get this msg?

Hi,
I have a script to determine the max memory to set a worker to start up at. The variable will need to end up being "-Xmx512m" or "-Xmx256m" or "-Xmx768m."
Everything works fine BUT when I set the "MEMORY" variable I get the "Cmmand not foundine 40: -Xmx512m" msg though the variable is the correct value and it starts up fine. Why do I get this message? Does it have something to do with "-" or "x"?

Script below:
maxMemSize=`grep '^'$branchCode $MEMORY_SIZE_DIR/LoaderMemoryAndUploadFileSize.properties | cut -d= -f 2`;
MEMORY= -Xmx$maxMemSize
# 2  
Old 11-29-2010
Code:
MEMORY= -Xmx$maxMemSize

Did you enter this as is ?

1) You shouldn't have space after = sign
2) You should use quote
# 3  
Old 11-29-2010
Quote:
Originally Posted by ctsgnb
Code:
MEMORY= -Xmx$maxMemSize

Did you enter this as is ?

1) You shouldn't have space after = sign
2) You should use quote
yes, I will make changes thanks

---------- Post updated at 12:56 PM ---------- Previous update was at 12:50 PM ----------

hmm, strange
So if I do this
MEMORY= '-Xmx'$maxMemSize
my worker starts up correctly but I get the error msg listed above.
if I do this
MEMORY='-Xmx'$maxMemSize or MEMORY=-Xmx$maxMemSize
I dont get the error msg and the worker doesnt start up...ideas?

my line to startup a worker is below(if it helps)
nohup $JAVA_HOME/bin/java -DappName=IPLoader -Xms128m $MEMORY -Duser.timezone=GMT -verbose:gc -cp $IPWORKER_CLASSPATH:$IPWORKER_HOME:$CLASSPATH Loader $LOADER_DIR >> $logfile 2>&1 &

Last edited by vsekvsek; 11-29-2010 at 02:02 PM..
# 4  
Old 11-29-2010
What gives

Code:
MEMORY="-Xmx$maxMemSize"

?
# 5  
Old 11-29-2010
also try..
MEMORY="-Xmx${maxMemSize}"
# 6  
Old 11-29-2010
Quote:
Originally Posted by ctsgnb
What gives

Code:
MEMORY="-Xmx$maxMemSize"

?
it gives the memory setting like "Xmx765m" or something similair
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Linux

Linux extacting msg from script to console

how to get the outout from script to console. i am running one script msg.sh using cron job every suday midnight. as soon as i logged in i want to see the staus is service started or service failed on console. what command i need to add to script ? msg.sh #!/bin/bash if then echo... (1 Reply)
Discussion started by: saku
1 Replies

2. UNIX for Dummies Questions & Answers

Warning msg from .sh script to web user?

Hello out there, I got a script that stops and restarts a webapp. I would like to be able to send warning reminders to the webusers as a warning like 5 minutes before it happens. Can I do this an if so how? (1 Reply)
Discussion started by: vsekvsek
1 Replies

3. Shell Programming and Scripting

Script not working in cron but working fine manually

Help. My script is working fine when executed manually but the cron seems not to catch up the command when registered. The script is as follow: #!/bin/sh for file in file_1.txt file_2.txt file_3.txt do awk '{ print "0" }' $file > tmp.tmp mv tmp.tmp $file done And the cron... (2 Replies)
Discussion started by: jasperux
2 Replies

4. AIX

Error msg

When i run errpt -a, the output was below: --------------------------------------------------------------------------- LABEL: DMPCHK_NOSPACE IDENTIFIER: F89FB899 Date/Time: Tue Jan 17 15:00:02 BEIS Sequence Number: 28998 Machine Id: 0058C0CE4C00 Node Id: ... (2 Replies)
Discussion started by: Ivanku
2 Replies

5. Shell Programming and Scripting

Script is not working from cron while working manually

Hello, I am facing a very strange problem when I run my script manuallu ./Fetchcode which is using to connect with MKS integrity from linux end it workks fine but when I run it from cron it doesn't work.Can someone help me 1) How could I check my script when it is running from cron like... (3 Replies)
Discussion started by: anuragpgtgerman
3 Replies

6. UNIX for Dummies Questions & Answers

connecting to a database through a script...if not give an error msg

Hello , i have a problem in writing the shell script.. i have a script already written n just need to make a change in which when the script is not able to connect to the database ..it should print an error msg on the screen. I have already seen previous posts on how to connect to the... (3 Replies)
Discussion started by: sommer_queen
3 Replies

7. Shell Programming and Scripting

msg??

I want to display a message when the script is done running, but I do not want to use echo. Is there another command I can use besides echo? If so, show me how it is done. (1 Reply)
Discussion started by: dshea0001
1 Replies

8. Programming

msg q

hi... i posted the code earlier but it wasnt quite readbale... ive added a few comments and made the indentation problem right... the problem is that it doent seem to be working... ive almost pulled out my hair tryin to fix the prob another wierd thing is that it worksthe 1st time when i... (0 Replies)
Discussion started by: strider
0 Replies

9. Programming

msg q again!

is it possible to use a msg queue with multiple threads spawned from the same app? (1 Reply)
Discussion started by: strider
1 Replies

10. IP Networking

Netstat msg

What do you think of the netstat msg about : udp 2320 0 *:xdmcp *:* The 2320? Does that mean an error? I used netstat -l | grep 'xdmcp' to get that, but does the 2320 indicate an error? I'm trying to figure out why, after i've enabled xdmcp to true, it is still not showing up... (2 Replies)
Discussion started by: kymberm
2 Replies
Login or Register to Ask a Question