Thank you Gary for your reply. It is actually the substring of the line that I have to check. Here's the sed command that I use:
sed 's/^JVM_OPTS=\"/&\-Xbootclasspath\/p\:\/eng\/x.jar <sed_test.sh >sed_test_new.sh As you can see, I am matching this substring *JVM_OPTS+"* at the beginning of the JVM_OPTS line in the script, and inserting my bootclasspath argument right after. I am going to look at your code, and see if I can either get it to work for my case, or come up with something that works. Thanks!! Vicki On Monday, March 26, 2012 3:34:21 PM UTC-7, vicki wrote: > > Hello, > I need to add the JVM arguments to the script based on some condition. > First I need to check whether the string representing these args is > already there. Can Puppet check the existence a substring and return > with a code just like java indexOf(substr) does? > > Thank you. > Vicki -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To view this discussion on the web visit https://groups.google.com/d/msg/puppet-users/-/U9yr46xclUwJ. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
