Sponsored Content
Top Forums UNIX for Dummies Questions & Answers How to call a local function within Awk Post 302226259 by CAGIRL on Monday 18th of August 2008 03:36:28 PM
Old 08-18-2008
Thank you very much, I appreciate your help.
The problem I am still having is that I am looking to find the final extension of a file name and the file name may have multiple nodes.

If the l_comp="dc000.runksh.test.ksh|/dbmgtu01/app/oracle/orbitz/1.0.0/sql/dc0000.runksh_test.sql|new.dat|control.ctl"

lf_verify_component () {

l_comp_file=$i
l_comp_suffix=${i#*.}

echo ' Component File: ' $l_comp_file
echo ' Component Suffix: ' $l_comp_suffix

} # end of lf_verify_component

The outpiut I get is:
Component File: dc000.runksh.test.ksh
Component Suffix: runksh
Component File: /dbmgtu01/app/oracle/orbitz/1.0.0/sql/dc0000.runksh_test.sql
Component Suffix: 0
Component File: new.dat
Component Suffix: dat
Component File: control.ctl
Component Suffix: ctl

How can I code it so that it only gives me the string after the final "."?
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

call function

I have a function check_ok in my abc.sh. which return me 1 or 0 . I want to call this fuction through other shell script. this shell also send two parameter to calling function. Can you please tell me how. I am very new in unix. #!/bin/bash date_equal() { sqlplus -silent... (4 Replies)
Discussion started by: Jamil Qadir
4 Replies

2. Shell Programming and Scripting

function call

hi, can any one help me to correct this function call. awk -F "," '{ {first=$1; sec=$2; tro=$3;quat=$4 } if (tro == "") { $3 = search "$file2" "$first" "$file3" {print $1","$2","$3","$4} } else {print $1","$2","$3 $4}}' $file1 > $file search () { (2 Replies)
Discussion started by: kamel.seg
2 Replies

3. Shell Programming and Scripting

How to execute local function in awk

Hi All, Can you please tell me how to execute local function written in a shell script with awk. i tried with system command but its giving an error. (1 Reply)
Discussion started by: krishna_gnv
1 Replies

4. Infrastructure Monitoring

diffrence between method call and function call in perl

Hello, I have a problem with package and name space. require "/Mehran/DSGateEngineLib/general.pl"; use strict; sub System_Status_Main_Service_Status_Intrusion_Prevention { my %idpstatus; my @result; &General_ReadHash("/var/dsg/idp/settings",\%idpstatus); #print... (4 Replies)
Discussion started by: Zaxon
4 Replies

5. Shell Programming and Scripting

awk , function call problem

#!/bin/bash awk ' function ad(t,r){ return (t+r); } BEGIN{ print ad(5,3); } { print ad(5,3); } ' Doesn't print anything for the last print ad(5,3); (6 Replies)
Discussion started by: cola
6 Replies

6. Shell Programming and Scripting

remotely call function from local script

The following code doesn't work properly which means it doesn't displays remote output. #!/bin/ksh #################### Function macAddressFinder ######################## macAddressFinder() { `ifconfig -a > ipInterfaces` `cat ipInterfaces` }... (2 Replies)
Discussion started by: presul
2 Replies

7. Shell Programming and Scripting

Call shell script function from awk script

hi everyone i am trying to do this bash> cat abc.sh deepak() { echo Deepak } deepak bash>./abc.sh Deepak so it is giving me write simply i created a func and it worked now i modified it like this way bash> cat abc.sh (2 Replies)
Discussion started by: aishsimplesweet
2 Replies

8. Shell Programming and Scripting

After exit from function it should not call other function

Below is my script that is function properly per my conditions but I am facing one problem here that is when one function fails then Iy should not check other functions but it calls the other function too So anyone can help me how could i achieve this? iNOUT i AM GIVING TO THE... (1 Reply)
Discussion started by: rohit22hamirpur
1 Replies

9. UNIX for Beginners Questions & Answers

Call user defined function from awk

My requirement is to call function ("fun1") from awk, and print its returned value along with $0. fun1() { t=$1 printf "%02d\n", $t % 60; } echo "Hi There 23" | awk '{print $0; system(fun1 $3)}' Any suggestions what to be modified in above code to achieve requirement.. (5 Replies)
Discussion started by: JSKOBS
5 Replies

10. Shell Programming and Scripting

awk call in bash function called with arugments not working, something lost in translation?

Hello, I have this awk code in a bash script to perform a find and replace task. This finds one unique line in a file and substitutes the found line with a replacement. #! /bin/bash # value determined elsewhere total_outputs_p1=100 # file being modified... (5 Replies)
Discussion started by: LMHmedchem
5 Replies
POE::Component::Server::SimpleHTTP::Connection(3pm)	User Contributed Perl Documentation    POE::Component::Server::SimpleHTTP::Connection(3pm)

NAME
POE::Component::Server::SimpleHTTP::Connection - Stores connection information for SimpleHTTP SYNOPSIS
use POE::Component::Server::SimpleHTTP::Connection; my $connection = POE::Component::Server::SimpleHTTP::Connection->new( $socket ); # Print some stuff print $connection->remote_port; DESCRIPTION
This module simply holds some information from a SimpleHTTP connection. METHODS my $connection = POE::Component::Server::SimpleHTTP::Connection->new( $socket ); $connection->remote_ip(); # Returns remote ip in dotted quad format ( 1.1.1.1 ) $connection->remote_port(); # Returns remote port $connection->remote_addr(); # Returns true remote address, consult the L<Socket> POD $connection->local_addr(); # Returns true local address, same as above $connection->local_ip(); # Returns local ip in dotted quad format ( 1.1.1.1 ) $connection->local_port(); # Returns local port $connection->dead(); # Returns a boolean value whether the socket is closed or not $connection->ssl(); # Returns a boolean value whether the socket is SSLified or not $connection->sslcipher(); # Returns the SSL Cipher type or undef if not SSL $connection->ID(); # unique ID of this connection EXPORT Nothing. SEE ALSO
POE::Component::Server::SimpleHTTP, POE::Component::Server::SimpleHTTP::Response AUTHOR
Apocalypse <apocal@cpan.org> Chris "BinGOs" Williams <chris@bingosnet.co.uk> COPYRIGHT AND LICENSE
Copyright X Apocalypse and Chris Williams This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. perl v5.14.2 2011-12-28 POE::Component::Server::SimpleHTTP::Connection(3pm)
All times are GMT -4. The time now is 08:13 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy