04-06-2019
Hello nag_sathi,
This is called "parameter expansion" see following from documentation.
Quote:
${parameter%word}
${parameter%%word}
The word is expanded to produce a pattern and matched according to the rules described below (see Pattern Matching). If the pattern matches If the pattern matches a trailing portion of the expanded value of parameter, then the result of the expansion is the value of parameter with the shortest matching pattern (the ‘%' case) or the longest matching pattern (the ‘%%' case) deleted. If parameter is ‘@' or ‘*', the pattern removal operation is applied to each positional parameter in turn, and the expansion is the resultant list. If parameter is an array variable subscripted with ‘@' or ‘*', the pattern removal operation is applied to each member of the array in turn, and the expansion is the resultant list
Here is the link for understanding parameter expansion too.
Shell Parameter Expansion (Bash Reference Manual)
I hope this helps.
Thanks,
R. Singh
These 2 Users Gave Thanks to RavinderSingh13 For This Post:
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
I have converted data written on excel sheet in unix through shell & perl prg
now the problem is I want that if starting columns of the xls sheet is Blank than when data is converted into unix then it should appear with this '|' sign. but it appearing like this:
hfgg|tytt|
but I want like... (2 Replies)
Discussion started by: akash
2 Replies
2. Shell Programming and Scripting
hi friends i want to know details of `exec` exact use of this command .....
actually i went through the man page but i didn`t get the satisfactory ...conclusion....
thaks in advance.... (1 Reply)
Discussion started by: newson
1 Replies
3. Shell Programming and Scripting
find /A/B/C/{1,3,5,7} -name "*.txt" -o -name "*.csv" -o -name "*.TXT" -o -name "*.dat" |xargs ls -ltr |awk '{print $8 ,$9}' > result.xls
it will give the result that is $8 and &9 in the result file...
let say i need the result is a excel file....and i need the result to be print like $8 field... (10 Replies)
Discussion started by: sapan123
10 Replies
4. UNIX for Dummies Questions & Answers
I just started to learn unix -
need help to write a script to query a logfile and produce the results that
contains a specific word "alarm" for a period from X day to Y day.
I really have no idea how to begin - :(
please help...
____________________________________________________
#... (1 Reply)
Discussion started by: snipfer
1 Replies
5. Shell Programming and Scripting
I would like to use the result of a query in another query. How do I redirect/add the output to another variable?
$result = odbc_exec($connect, $query);
while ($row = odbc_fetch_array($result)) {
echo $row,"\n";
}
odbc_close($connect);
?>
This will output hostnames:
host1... (0 Replies)
Discussion started by: hazno
0 Replies
6. Shell Programming and Scripting
Hi,
I have a requirement as below which needs to be done viz UNIX shell script
(1) I have to connect to an Oracle database
(2) Exexute "SELECT field_status from table 1" query on one of the tables.
(3) Based on the result that I get from point (2), I have to update another table in the... (6 Replies)
Discussion started by: balaeswari
6 Replies
7. Shell Programming and Scripting
hi
i want to make script. where i want to query from the user yes or no
exp: do you want to proceed :
y for yes
n for NO.
how this is possible in unix (3 Replies)
Discussion started by: dodasajan
3 Replies
8. Shell Programming and Scripting
Hi expert,
I have a script which is connecting with sql internally, fetch same data, store it in a file and then from os I cat this file and sending it to mail (windows outlook).
This is working fine, I just need to know wether we can add some html codes with the sql query like we can add... (0 Replies)
Discussion started by: mcagaurav
0 Replies
9. Programming
Below i have the sample code. i need to pass the entire query from file or as parameter and read the results and write into a output file.
here the number of columns are unknown. some times it may be 2,3 or entire columns from the table.
read all the column results and write into a comma... (0 Replies)
Discussion started by: laknar
0 Replies
10. Shell Programming and Scripting
Hi,
I need to query Oracle database for 100 users. I have these 100 users in a file. I need a shell script which would read this User file (one user at a time) & query database.
For instance:
USER CITY
--------- ----------
A CITY_A
B CITY_B
C ... (2 Replies)
Discussion started by: DevendraG
2 Replies
LEARN ABOUT DEBIAN
tm::axes
TM::Axes(3pm) User Contributed Perl Documentation TM::Axes(3pm)
NAME
TM::Axes - Topic Maps, Axes for TM::match*
DESCRIPTION
The TM module offers the method "match" (and friends) to query assertions in a TM data structure. While there is a generic search
specification, it will be too slow. Instead some axes have been implemented specifically. These are listed below.
SEARCH SPECIFICATIONS
Automatically generated from TM (1.54)
Code:<empty>
returns all assertions
Code:anyid
return all assertions where a given toplet appears somehow
'anyid' => 'the toplet'
Code:aplayer.arole.bplayer.brole.type
return all assertions of a given type where a given toplet plays a given role and there exist another given role with another given
toplet as player
'bplayer' => 'the player for the brole',
'aplayer' => 'the player toplet for the arole',
'arole' => 'the role toplet (incl subclasses) for the aplayer',
'type' => 'the type of the assertion',
'brole' => 'the other role toplet (incl subclasses)'
Code:aplayer.arole.brole.type
return all assertions of a given type where a given toplet plays a given role and there exist another given role
'aplayer' => 'the player toplet for the arole',
'arole' => 'the role toplet (incl subclasses) for the aplayer',
'type' => 'the type of the assertion',
'brole' => 'the other role toplet (incl subclasses)'
Code:char.irole
deprecated: return all assertions which are characteristics for a given toplet
'irole' => 'the toplet for which characteristics are sought',
'char' => '1'
Code:char.topic
return all assertions which are characteristics for a given toplet
'topic' => 'the toplet for which characteristics are sought',
'char' => '1'
Code:char.topic.type
return all assertions which are a characteristic of a given type for a given topic
'topic' => 'the toplet for which these characteristics are sought',
'char' => '1',
'type' => 'type of characteristic'
Code:char.type
return all assertions which are characteristics for some given type
'char' => '1',
'type' => 'the characteristic type'
Code:char.type.value
return all assertions which are characteristics for some topic of a given value for some given type
'value' => 'the value for which all characteristics are sought',
'char' => '1',
'type' => 'the characteristic type'
Code:char.value
return all assertions which are characteristics for some topic of a given value
'value' => 'the value for which all characteristics are sought',
'char' => '1'
Code:class.type
returns all assertions where there are instances of a given toplet
'class' => 'which toplet should be the class',
'type' => 'isa'
Code:instance.type
returns all assertions where there are classes of a given toplet
'type' => 'isa',
'instance' => 'which toplet should be the instance'
Code:iplayer
return all assertions where a given toplet is a player
'iplayer' => 'the player toplet'
Code:iplayer.irole
return all assertions where a given toplet is a player of a given role
'iplayer' => 'the player toplet',
'irole' => 'the role toplet (incl subclasses)'
Code:iplayer.irole.type
return all assertions of a given type where a given toplet is a player of a given role
'iplayer' => 'the player toplet',
'irole' => 'the role toplet (incl subclasses)',
'type' => 'the type of the assertion'
Code:iplayer.type
return all assertions of a given type where a given toplet is a player
'iplayer' => 'the player toplet',
'type' => 'the type of the assertion'
Code:irole
return all assertions where there is a given role
'irole' => 'the role toplet (incl subclasses)'
Code:irole.type
return all assertions of a given type where there is a given role
'irole' => 'the role toplet (incl subclasses)',
'type' => 'the type of the assertion'
Code:lid
return one particular assertions with a given ID
'lid' => 'the ID of the assertion'
Code:nochar
returns all associations (so no names or occurrences)
'nochar' => '1'
Code:subclass.type
returns all assertions where there are subclasses of a given toplet
'subclass' => 'which toplet should be the superclass',
'type' => 'is-subclass-of'
Code:superclass.type
returns all assertions where there are superclasses of a given toplet
'superclass' => 'which toplet should be the subclass',
'type' => 'is-subclass-of'
Code:type
return all assertions with a given type
'type' => 'the type of the assertion'
SEE ALSO
TM
COPYRIGHT AND LICENSE
Copyright 200[8] by Robert Barta, <drrho@cpan.org>
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
perl v5.10.1 2010-06-20 TM::Axes(3pm)