10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi,
I am having script which contains many functions. Need to print each function name at the starting of the function. Like below,
functionname()
{
echo "functionname"
commands....
}
I've tried like below,
func=`grep "()" scriptname | cut -d "(" -f1`
for i in $func
do
nawk -v... (4 Replies)
Discussion started by: Sumanthsv
4 Replies
2. Shell Programming and Scripting
Hi All,
I am using geopts inside a function in shell script.
But it is doesnt seem to read the input args and I always gt empty value in o/p.
my code is
http://sparshmail.ad.infosys.com/owa/14.2.318.4/themes/base/pgrs-sm.gif
This message has not been sent.
#!/bin/ksh IFS=' '... (1 Reply)
Discussion started by: prasperl
1 Replies
3. Shell Programming and Scripting
I have a script that has to execute a read command in a function, this is in an ash busybox.
The code is...
trapcatch () { echo "Ctl-c Detected, what do you want to do?"
echo "Please choose the number of one of the following options"
echo "1. Jump past this Set"
echo "2. Exit... (8 Replies)
Discussion started by: tesser
8 Replies
4. Shell Programming and Scripting
I'm a beginner in shell scripting (I'm using ksh). I'm manipulating some files and I'm using set -A to transform each read line into a numeric array.
However, inside the 'for' loop the options of set (ie '-A') are not recognized (the vi editor doesn't highlight it and it doesn't work).
Where... (4 Replies)
Discussion started by: kasumlolla
4 Replies
5. Shell Programming and Scripting
The string comparison highlighted below is not working fine. Please help:
while read line
do
# Get File name by deleting everything that preceedes and follows Filename as printed in cvs status' output
f_name=`echo $line | sed -e 's/^File://' -e 's/ *Status:.*//' | awk '{print $NF}'`
... (4 Replies)
Discussion started by: sudvishw
4 Replies
6. Shell Programming and Scripting
Hi,
In the code included below, the string comparision is not working fine. Please help
while (( find_out >= i ))
do
file=`head -$i f.out|tail -1`
dir=`dirname $file`
cd $dir
Status=""
if ; then
Status=`cvs -Q status... (3 Replies)
Discussion started by: sudvishw
3 Replies
7. Shell Programming and Scripting
I'm trying to understand if it's possible to create a set of variables that are numbered based on another variable (using eval) in a loop, and then call on it before the loop ends.
As an example I've written a script called question (The fist command is to show what is the contents of the... (2 Replies)
Discussion started by: DeCoTwc
2 Replies
8. Shell Programming and Scripting
Hi All,
I am comparing two strings inside an if condition if the strings are same then it should go inside the loop else it should execute code given in else part.
But there is a but inside my script
Even if the if condition is true
it is not going inside the loop also it is executing... (4 Replies)
Discussion started by: usha rao
4 Replies
9. Shell Programming and Scripting
#! /bin/ksh
..(some lines are here..)
for t in (LIST)
do
a=function($t)
#here I want to wait till the function hangs for 5 secs else want to continue the loop for other values of t.
done
if ;then
.............
fi
......
......................
Suppose in this script;... (7 Replies)
Discussion started by: Niroj
7 Replies
10. Shell Programming and Scripting
set -A arr a1 a2 a3 a4
# START
ssh -xq $Server1 -l $Username /usr/bin/ksh <<-EOS
integer j=0
for loop in ${arr}
do
printf "array - ${arr}\n"
(( j = j + 1 ))
j=`expr j+1`
done
EOS
# END
=========
this is not giving me correct output.
I... (5 Replies)
Discussion started by: reldb
5 Replies