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
Hi All,
I have created one function for KSH and was running well with one parameter input since I just had to use $1 to get the parameter.
Now I want to do loop for each parameter(actually filenames) . I have try to use do loop, but $i does not resolve to parameter instead it resolves to 1,... (5 Replies)
Discussion started by: mysocks
5 Replies
3. Shell Programming and Scripting
Hi guys,
can someome help with this question, I have defined a function that takes a command as a parameter, but when the command is executed from the function it will throw errors because what I believe is a special character escaping issue. I tried using the backslash to escape the pipe | and >... (2 Replies)
Discussion started by: marouanix
2 Replies
4. 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
5. 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
6. Shell Programming and Scripting
Hi,
I have an output generated from a shell script like;
0x41,0xF2,0x59,0xDD,0x86,0xD3,0xEF,0x61,0xF2
How can I pass this value to the C function, as below;
int main(int argc, char *argv) {
unsigned char hellopdu={above value};
}
Regards
Elthox (1 Reply)
Discussion started by: elthox
1 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
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
9. 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
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