Sponsored Content
Full Discussion: Substring in Shell Script
Top Forums UNIX for Dummies Questions & Answers Substring in Shell Script Post 302131087 by smartbuddy on Thursday 9th of August 2007 06:26:03 AM
Old 08-09-2007
Substring in Shell Script

Hi

I'm new to Shell scripting. Someone please help me in extracting a portion of string from a file.

Eg:

I got a file like, Readme.txt and has the following name value pairs

input1 : /homes/input1/
input2 : /homes/input2/
...
...

When I give the parameter input1, the value /homes/input1/ has to returned from the file and get stored in a variable.

Thanks in advance.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Substring in C shell script?

i am a new user of C-shell script. I want to know can i create a substring in a string. That means when i got a variable $input = "it is number 2" I want to get the "2" to be another variable. Can i do that in C-shell and how to ? Thank you so much dinodash (0 Replies)
Discussion started by: dinodash
0 Replies

2. Shell Programming and Scripting

Substring function in UNIX shell script

Hi All, Following is the output of a find commnd to locate log directories for various projects of UNIX AIX box: /home/hbinz6pf/projectlibs/dpr_pfsdw_dev/&PH& /opt/tools/ds/Template/&PH& /data/ds/ms/hmsdw/projectlibs/dpr_ms_dev/&PH& /data/ds/riskmi/projectlibs/dpr_riskmi_dev/&PH&... (1 Reply)
Discussion started by: csrazdan
1 Replies

3. UNIX for Dummies Questions & Answers

Substring function in UNIX shell script

Hi All, Following is the output of a find commnd to locate log directories for various projects of UNIX AIX box: /home/hbinz6pf/projectlibs/dpr_pfsdw_dev/&PH& /opt/tools/ds/Template/&PH& /data/ds/ms/hmsdw/projectlibs/dpr_ms_dev/&PH& /data/ds/riskmi/projectlibs/dpr_riskmi_dev/&PH&... (5 Replies)
Discussion started by: csrazdan
5 Replies

4. Shell Programming and Scripting

help for shell script of finding shortest substring from given string by user

please give me proper solution for finding a shortest substring from given string if string itself and first char and last char of that substr are also given by user if S="dpoaoqooroo" and FC="o" and LC="o",then shortest substr is "oo" and rest of the string is "dpoaoqroo" i have code but it is... (1 Reply)
Discussion started by: pankajd
1 Replies

5. Shell Programming and Scripting

Substring in shell script

I need a help in getting substring of each line in input file. I am writing a script that will read a file from a directory on daily basis, I mean everyday a new file will be stored in this directory, it will replace old file. I have to read contents of this file, the contents will be as... (5 Replies)
Discussion started by: jyotib
5 Replies

6. Shell Programming and Scripting

shell script for extracting out the shortest substring from the given starting and en

hi all, i need an urgent help for writing a shell script which will extract out and print a substring which is the shortest substring from the given string where first and last character of that substring will be given by the user. for e.g. if str="abcdpqracdpqaserd" now if the user gives 'a'... (18 Replies)
Discussion started by: pankajd
18 Replies

7. Shell Programming and Scripting

using substring in shell script

This is the data I am having in a file Just for sample I have given 3 records. The file which I am having consists of n number of records. ABC123 10 01/02/2008 2008-01-03-00.00.00.000000 DYUU 22 02/03/2008 2008-01-04-00.00.00.000000 RF33 88 03/05/2008 2008-01-05-00.00.00.000000 ... (24 Replies)
Discussion started by: kmanivan82
24 Replies

8. Shell Programming and Scripting

Need help with Korn Shell script for substring printing

Hi all, I am new to scripting. I have a file with colon separated values called mylist.txt cat mylist.txt 192.123.76.89:lmprod89 162.122.20.28:lmtstserver28 10.80.32.139:hewprod139 . . using our internal os utility (called mvsping) we need to check all these servers if they are... (6 Replies)
Discussion started by: kraljic
6 Replies

9. Shell Programming and Scripting

Substring check in IF condition in shell script

I want to check if the string has the substring in IF condition then process... i tried below but not working if ]; then ............. field can be "reserved1" ....reservedn / fillspaces1 ... fillspacesn (4 Replies)
Discussion started by: greenworld123
4 Replies

10. Shell Programming and Scripting

Script Shell Extract substring

Hi all, Please, i'd like to extract string just before '.fr'. Here is some lines of my file: g-82.text.text1.fr.worker1 g-xx.yyyyyy.zzzz.fr.worker2 i'd like to extract this text: g-82.text.text1 g-xx.yyyyyy.zzzz Please, which command i have to use in my script shell ? ... (16 Replies)
Discussion started by: chercheur111
16 Replies
SoTriggerAny(3) 						       Coin							   SoTriggerAny(3)

NAME
SoTriggerAny - The SoTriggerAny class is a fan-in engine for triggers. When any one of the input triggers are 'pulsed', any field connected as a slave to the engine output will be notified. SYNOPSIS
#include <Inventor/engines/SoTriggerAny.h> Inherits SoEngine. Public Member Functions virtual SoType getTypeId (void) const virtual const SoFieldData * getFieldData (void) const virtual const SoEngineOutputData * getOutputData (void) const SoTriggerAny (void) Static Public Member Functions static SoType getClassTypeId (void) static void * createInstance (void) static void initClass (void) Public Attributes SoSFTrigger input0 SoSFTrigger input1 SoSFTrigger input2 SoSFTrigger input3 SoSFTrigger input4 SoSFTrigger input5 SoSFTrigger input6 SoSFTrigger input7 SoSFTrigger input8 SoSFTrigger input9 SoEngineOutput output Protected Member Functions virtual ~SoTriggerAny (void) Static Protected Member Functions static const SoFieldData ** getInputDataPtr (void) static const SoEngineOutputData ** getOutputDataPtr (void) Detailed Description The SoTriggerAny class is a fan-in engine for triggers. When any one of the input triggers are 'pulsed', any field connected as a slave to the engine output will be notified. Constructor &; Destructor Documentation SoTriggerAny::SoTriggerAny (void) Default constructor. SoTriggerAny::~SoTriggerAny (void) [protected], [virtual] Destructor is protected because explicit destruction of engines is not allowed. Member Function Documentation SoType SoTriggerAny::getClassTypeId (void) [static] This static method returns the SoType object associated with objects of this class. Reimplemented from SoEngine. SoType SoTriggerAny::getTypeId (void) const [virtual] Returns the type identification of an object derived from a class inheriting SoBase. This is used for run-time type checking and 'downward' casting. Usage example: void foo(SoNode * node) { if (node->getTypeId() == SoFile::getClassTypeId()) { SoFile * filenode = (SoFile *)node; // safe downward cast, knows the type } } For application programmers wanting to extend the library with new nodes, engines, nodekits, draggers or others: this method needs to be overridden in all subclasses. This is typically done as part of setting up the full type system for extension classes, which is usually accomplished by using the pre-defined macros available through for instance Inventor/nodes/SoSubNode.h (SO_NODE_INIT_CLASS and SO_NODE_CONSTRUCTOR for node classes), Inventor/engines/SoSubEngine.h (for engine classes) and so on. For more information on writing Coin extensions, see the class documentation of the toplevel superclasses for the various class groups. Implements SoBase. const SoFieldData ** SoTriggerAny::getInputDataPtr (void) [static], [protected] Returns the SoFieldData class which holds information about inputs in this engine. Reimplemented from SoEngine. const SoEngineOutputData ** SoTriggerAny::getOutputDataPtr (void) [static], [protected] Returns the SoEngineOutputData class which holds information about the outputs in this engine. Reimplemented from SoEngine. const SoFieldData * SoTriggerAny::getFieldData (void) const [virtual] Returns a pointer to the class-wide field data storage object for this instance. If no fields are present, returns NULL. Reimplemented from SoFieldContainer. const SoEngineOutputData * SoTriggerAny::getOutputData (void) const [virtual] This API member is considered internal to the library, as it is not likely to be of interest to the application programmer. Implements SoEngine. void SoTriggerAny::initClass (void) [static] Sets up initialization for data common to all instances of this class, like submitting necessary information to the Coin type system. Reimplemented from SoEngine. Member Data Documentation SoSFTrigger SoTriggerAny::input0 Input trigger. SoSFTrigger SoTriggerAny::input1 Input trigger. SoSFTrigger SoTriggerAny::input2 Input trigger. SoSFTrigger SoTriggerAny::input3 Input trigger. SoSFTrigger SoTriggerAny::input4 Input trigger. SoSFTrigger SoTriggerAny::input5 Input trigger. SoSFTrigger SoTriggerAny::input6 Input trigger. SoSFTrigger SoTriggerAny::input7 Input trigger. SoSFTrigger SoTriggerAny::input8 Input trigger. SoSFTrigger SoTriggerAny::input9 Input trigger. SoEngineOutput SoTriggerAny::output (SoSFTrigger) Connect to the output with the field(s) you want notified upon any input trigger 'pulses'. Author Generated automatically by Doxygen for Coin from the source code. Version 3.1.3 Wed May 23 2012 SoTriggerAny(3)
All times are GMT -4. The time now is 05:16 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy