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. UNIX for Dummies Questions & Answers
Below are three variables, which I want to pass into variable RESULT1
username1=userid
poihostname1=dellsys.com
port1=8080
How can I pass these variables into below code...
RESULT1=$((ssh -n username1@poihostname1 time /usr/sfw/bin/wget --user=sam --password=123 -O /dev/null -q... (4 Replies)
Discussion started by: manohar2013
4 Replies
3. Shell Programming and Scripting
Hello, I have two bash scripts like the following:
script 1:
#!/bin/bash
var=WORLD
bash path/to/second/script/script2.bash
script 2:
#!/bin/bash
echo "HELLO $var"
I expected the output to be "HELLO WORLD" but instead, I get "HELLO". I understand that when I envoke another bash... (2 Replies)
Discussion started by: jl487
2 Replies
4. Shell Programming and Scripting
Hi,
Please help me here while passing the paramert to fuction i am facing problem.
i tryied passing 7 PARAMeter in side single quote,double quate even tried tild sign not working.
how can assign it properly .
usage ()
{
typeset -i NumPARAMs=$1
typeset -i PARAM1=$2
typeset PARAM2=$3... (3 Replies)
Discussion started by: nitindreamz
3 Replies
5. Shell Programming and Scripting
I have the following code :
function1 ()
{
print "January"
}
function2()
{
case $1 in
January)
print "Dzisiaj mamy styczen"
;;
*)
;;
}
main()
{ (1 Reply)
Discussion started by: presul
1 Replies
6. Shell Programming and Scripting
Hi, for example I have this function:
function get_param ()
{
test=echo "some string"
test2=echo "someother string"
}
I want to call this function and get test or test2 result, how do I do that ?
Thank you (2 Replies)
Discussion started by: ktm
2 Replies
7. 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
8. Shell Programming and Scripting
HI all
I am calling a script "b" from script "a". In script "a", i connect to database and get month and year. I have to pass these same values to script b. How can i do that. How can i pass parameters from one script to another (3 Replies)
Discussion started by: vasuarjula
3 Replies
9. Shell Programming and Scripting
I want to pass an array in my function, And my function will be changing the elements of the array in the fuction, but it should not affect the values in my array variable of main function (1 Reply)
Discussion started by: ranjithpr
1 Replies
10. 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