10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
updateEnvironmentField() {
linewithoutquotes=`echo $LINE | tr -d '"'`
b()
}
I want to pass variable named $linewithoutquotes to another method called b(), which is called from updateEnvironmentField() method. How to do the above requirement with shell script (1 Reply)
Discussion started by: pottic
1 Replies
2. Shell Programming and Scripting
In one of my shell function I found the following
set_default_values () {
prog=$1
PROC_DT=$2
RESET_ALL="${3-N}"
#echo "Processing date as passed = , Program name = "
......
I understand the first and second arguments, but don't understand... (1 Reply)
Discussion started by: digioleg54
1 Replies
3. Shell Programming and Scripting
Hi all,
In the given script code .
I want to pass the maximum value that variable "i" will have in function DivideJobs () to variable $max of function SubmitCondorJob().
Any help?
Thanks
#!/bin/bash ... (55 Replies)
Discussion started by: nrjrasaxena
55 Replies
4. Shell Programming and Scripting
Hi,
I have 2 ksh scripts.
Script1.ksh contains function definition.
script1.ksh
function f1() {
while getopts a:c: args
do
case $args in
a) ARG1=$OPTARG ;;
c) ARG2=$OPTARG ;;
\?) echo "Error no valid Arguments passed"
esac
done
echo $ARG1
echo $ARG2
script2.sh (2 Replies)
Discussion started by: siba.s.nayak
2 Replies
5. Shell Programming and Scripting
Hi all,
I am having a problem with user defined function call. I am new into the concept of shell script UDFs.
My function is:
iterate_directory()
{
cd $1
k=0
for i in *
do
if
then
ARR=${i}
fi
done
echo ${ARR
}
} (4 Replies)
Discussion started by: canishk
4 Replies
6. Shell Programming and Scripting
HI all
I have a code like
##############################################
minyear()
{
curryear=$1
echo $curryear
}
##Main Program ##
minyear
exit
#######
when i execute "sh scriptname 2005" output should be like 2005 but the output is blank.
I guess i need to pass parameter to... (3 Replies)
Discussion started by: vasuarjula
3 Replies
7. Shell Programming and Scripting
Hi All,
Calling a function with one argument and storing the return value in a shell script is as below:( so far I know)
value="`fun_1 "argument1"`"
Its working perfectly for me.
Can u help me with passing more than one argument and storing the return value
Thnaks in advance
JS (1 Reply)
Discussion started by: jisha
1 Replies
8. Shell Programming and Scripting
Hi...
Actually, I want to pass a few variables to the function and print it. But, its looks like not working. Could some body help me how could i do that ?... below is my program...
#!/usr/bin/ksh
usage()
{
echo "Usage: $0 -n -a -s -w -d"
exit
}
rename()
{
echo "rename $1 $2"... (5 Replies)
Discussion started by: bh_hensem
5 Replies
9. UNIX for Dummies Questions & Answers
Hi,
Can someone please explain to me how I can get a function to recognize a file given as an argument to a script.
Suppose the script has the argument as follows:
sh script file
and the function is as follows:
function display_file () {
cat $1
}
and it s then called
#main program... (1 Reply)
Discussion started by: Knotty
1 Replies
10. UNIX for Dummies Questions & Answers
May i know how to pass an argument to a function in a shell script?
Sorry, i din stated that it is in a shell script in my previous post.
Means: checkStatus() {
...........
}
read status;
I wanna use the status in the function checkstatus, how... (2 Replies)
Discussion started by: AkumaTay
2 Replies