10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
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
2. UNIX for Beginners Questions & Answers
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
3. Shell Programming and Scripting
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
4. Shell Programming and Scripting
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
5. Shell Programming and Scripting
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
6. Shell Programming and Scripting
#!/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
7. Infrastructure Monitoring
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
8. Shell Programming and Scripting
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
9. Shell Programming and Scripting
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
10. Shell Programming and Scripting
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