i need a shell program to extract a substring from a main string..
for eg:- main string is madhu..
sub string is mad
o/p:- be mad.
try to solve this one (5 Replies)
i need a shell program,to extract a string from a main string.
main string is "madhu"
sub string is "mad"..means any word from the main string
please di this (1 Reply)
Hi, guys. I have one question:
I need to search for a string in a file, and then extract another string from the file and assign it to a variable.
For example:
the contents of the file (group) is below:
...
ftp:x:23:
mail:x:34
...
testing:x:2001
sales:x:2002
development:x:2003
...... (6 Replies)
hi all,
i have a file name using the following pattern:
PREFIX: AR
SOURCE: LEGACY
DATETIME: YYYYMMDD_HH24MISS
SUFFIX: .txt
sample filename:
AR_LEGACY_20101104_105500.txt
i want to extract the source which is LEGACY in this case. how do i do this using shell?
thanks. (4 Replies)
continuing from my previous post, whose link is given below as a reference
https://www.unix.com/shell-programming-scripting/171076-shell-scripting.html#post302573569
consider there is create table commands in a file for eg:
CREATE TABLE `Blahblahblah` (
`id` int(11) NOT NULL... (2 Replies)
Hi,
May i ask if someone share some command for extracting a string between 2 ref string in a txt file
My objective: i had a file with multiple lines and wants only to extract the string "watch?v=IbkAXOmEHpY" or "watch?v=<11 random character>", when i used "grep 'watch?=*' i got a results per... (4 Replies)
I have a string
string="Please have a nice day and sleep well Replace_12123_31233_32134_12342 Good day"
How do i replace "Replace_12123_31233_32134_1234" in the above string.??
Please help.
Regards,
Qwerty (3 Replies)
Need Assistance in shell programming... I have a huge file which has multiple stations and i wanted to search particular station and extract few lines from it and the rest is not needed
Bold letters are the stations . The whole file has multiple stations .
Below example i wanted to search... (4 Replies)
Hi Team
I have an huge xml where i need to search for a ceratin numbers. For example
2014-05-06 15:15:41,498 INFO WebContainer : 10 CommonServicesLogs - CleansingTriggerService.invokeCleansingService Entered PUBSUB NOTIFY MESSAGE () -
<?xml version="1.0" encoding="UTF-8"... (5 Replies)
Hello guys,
I have problem with hpux shell script. I have one big text file that contains like
SOH
bla bla bla
bla bla bla
ETX SOH
bla bla bla
ETX
SOH
bla bla bla
ETX
What I need to do is save first SOH*BLA into file1.txt, save second SOH*BLA into file2.txt and so on.... (17 Replies)
Discussion started by: sembii
17 Replies
LEARN ABOUT OSX
java_home
java_home(1) General Commands Manual java_home(1)NAME
java_home - return a value for $JAVA_HOME
SYNOPSIS
/usr/libexec/java_home [options]
DESCRIPTION
The java_home command returns a path suitable for setting the JAVA_HOME environment variable. It determines this path from the user's
enabled and preferred JVMs in the Java Preferences application. Additional constraints may be provided to filter the list of JVMs avail-
able. By default, if no constraints match the available list of JVMs, the default order is used. The path is printed to standard output.
OPTIONS -v or --version version
Filters the returned JVMs by the major platform version in "JVMVersion" form. Example versions: "1.5+", or "1.6*".
-a or --arch architecture
Filters the returned JVMs by the architecture they support. Example architectures: "i386", "x86_64", or "ppc".
-d or --datamodel datamodel
Filters the returned JVMs capable of running in 32 or 64-bit mode. Supported datamodels: "-d32" and "-d64". Specifying a datamodel
is synonymous with specifying a particular architecture.
-t or --task task
Selects from the list of JVMs which can run a specific task. The order of each of these lists is set by the Java Preferences appli-
cation. Supported tasks: "Applets", "WebStart", "BundledApp", "JNI" and "CommandLine". The default task is "CommandLine".
-F or --failfast
Immediately fails when filters return no JVMs; does not print out the path to the default $JAVA_HOME.
--exec command ...
Executes the command at $JAVA_HOME/bin/<command> and passes the remaining arguments. Any arguments to select which $JAVA_HOME to use
must precede the --exec option.
-X or --xml
Prints the list of selected JVMs and associated properties as an XML plist to stdout.
-V or --verbose
Prints the matching list of JVMs and architectures to stderr.
-h or --help
Brief usage information.
USAGE
/usr/libexec/java_home helps users set a $JAVA_HOME in their login rc files, or provides a way for command-line Java tools to use the most
appropriate JVM which can satisfy a minimum version or architecture requirement. The --exec argument can invoke tools in the selected
$JAVA_HOME/bin directory, which is useful for starting Java command-line tools from launchd plists without hardcoding the full path to the
Java command-line tool.
Usage for bash-style shells:
$ export JAVA_HOME=`/usr/libexec/java_home`
Usage for csh-style shells:
% setenv JAVA_HOME `/usr/libexec/java_home`
04 August 2010 java_home(1)