Sponsored Content
Top Forums Shell Programming and Scripting Shell script to change a value Post 302317454 by rijeshpp on Tuesday 19th of May 2009 03:39:53 AM
Old 05-19-2009
Shell script to change a value

I have a shell script that has following entry.

MEM_ARGS="-Xms256m -Xmx512m"
export MEM_ARGS

if [ "${JAVA_VENDOR}" = "Sun" ] ; then
if [ "${PRODUCTION_MODE}" = "" ] ; then
MEM_DEV_ARGS="-XX:CompileThreshold=8000 -XX:PermSize=48m "
export MEM_DEV_ARGS
fi
fi

# Had to have a separate test here BECAUSE of immediate variable expansion on windows

if [ "${JAVA_VENDOR}" = "Sun" ] ; then
MEM_ARGS="${MEM_ARGS} ${MEM_DEV_ARGS} -XX:MaxPermSize=512m"
export MEM_ARGS
fi

if [ "${JAVA_VENDOR}" = "HP" ] ; then
MEM_ARGS="${MEM_ARGS} -XX:MaxPermSize=128m"
export MEM_ARGS
fi

I want to change the line MEM_ARGS="-Xms256m -Xmx512m" to new value lets say MEM_ARGS="-Xms512m -Xmx1024m" . The intention is tha twhetever the value to be given it should go and set Xms and Xmx values.The problem here is that I can't find for word MEM_ARGS= and replace then becuase MEM_ARGS= is existing multiple places. So probably I need to search for "MEM_ARGS="-Xms" in this file and then replace the value that I want. Can you please suggest the best possible commands?

Thanks in advance,
Rijesh.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

script to change shell and prompt

I want to write a shell script which will change the current shell (say from csh to bsh) and my Prompt (say my name) as desired.pls help (1 Reply)
Discussion started by: SHYAM
1 Replies

2. Linux

Change directory in a shell script

How do u change ur directory using a shell script?? (12 Replies)
Discussion started by: laxmi
12 Replies

3. UNIX for Dummies Questions & Answers

Change the fonts in the shell script

Hi All, I want to change the font and colour while writing them to a .rtf file using a shell script. How can i do this? Thanks & Regards Dilip (1 Reply)
Discussion started by: DilipPanda
1 Replies

4. Shell Programming and Scripting

Change the Windows Batch script to UNIX shell script.

Hi, When I run the below script in UNIX it's throwing syntax errors. Actually it's a windows batch script. Could anyone change the below Windows Batch script to UNIX shell script... Script: REM :: File Name : Refresh_OTL.bat REM :: Parameters : %1 - Region REM :: : %2 - Cube Type REM ::... (5 Replies)
Discussion started by: tomailraj
5 Replies

5. Shell Programming and Scripting

directory change in shell script

Hi, I am trying to change the directory in my script, & want to check if the directory is present or not . Ex: cd /home/xyz/temp/logs if the logs directory is not present i want to show the error in script instead of shell script error. Can anybody please help me on the same Thx in... (2 Replies)
Discussion started by: vls1210
2 Replies

6. Shell Programming and Scripting

How to change a directory in shell script?

HI, I need to change the working directory by using the shell script /Export/home/user_name I have to go one step back like /Export/home Please help on this.:confused: (3 Replies)
Discussion started by: thelakbe
3 Replies

7. Shell Programming and Scripting

Shell Script to change a user password using script

Hi Experts, I had tried to executes this script to change the user password through script: No lines in buffer #!/bin/ksh cat /etc/passwd | grep -v userid >> /tmp/pass.tmp1 cat /etc/passwd | grep userid >> /tmp/pass.tmp2 PASS1=`cat /tmp/pass.tmp2 | cut -d ":" -f2` PASS2=`q2w3e4r5` sed... (3 Replies)
Discussion started by: indrajit_renu
3 Replies

8. Shell Programming and Scripting

script to change shell's pwd

Hi there, i was presented with a challenge that is beyond my current shell knowledge: how can you have a script that executed interactive will change your current working directory? Example (under MacOS): 1. start Terminal and my current working directory is my home folder 2. execute a... (3 Replies)
Discussion started by: gigagigosu
3 Replies

9. Shell Programming and Scripting

Shell script to change the ip

I am writing a simple DHCP server application that gets ip from a server at boot up ! i wrote a shell script to run the java program that obtains ip from server on another machine... The problem is when i have obtained the ip i store it in a file ! using awk i retrieve the... (1 Reply)
Discussion started by: dinesh17
1 Replies

10. Shell Programming and Scripting

Shell Script for Auto IP Change

Hi, I am newbie to Linux/Asterisk. I am trying to write a shell script that would look for my SIP trunk registration, if found UNREACHABLE then it would execute a command and check my local IP, if my local IP is 192.168.1.106 then it would change the IP to 192.168.1.150 and vice versa, after... (8 Replies)
Discussion started by: jeetz
8 Replies
exports(4)						     Kernel Interfaces Manual							exports(4)

NAME
exports, xtab - directories to export to NFS clients SYNOPSIS
DESCRIPTION
The file is obsolete and has been replaced by the new NFS file Please see dfstab(4) for more details. The file is also obsolete and has been replaced by the new NFS file Please see sharetab(4) for more details. The and the files are no longer used to export NFS directories. Any modifications made to these files will have no impact on NFS. These manpages will be removed from future releases of HP-UX. AUTHOR
was developed by Sun Microsystems, Inc. FILES
list of commands to be executed at boot time system record of shared file systems list of hostnames list of network groups network information script that executes command. SEE ALSO
share(1M), mountd(1M), nfsd(1M), dfstab(4), hosts(4), netgroup(4), networks(4), sharetab(4). TO BE OBSOLETED exports(4)
All times are GMT -4. The time now is 06:13 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy