10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hello All,
I would like to ask help from you on how to pass variable value from a function that has been called inside the function. I have created below and
put the variables in " ". Is there another way I can do this? Thank you in advance.
readtasklist() {
while read -r mod ver... (1 Reply)
Discussion started by: aderamos12
1 Replies
2. UNIX for Dummies Questions & Answers
May i please know why is it printing the script name for $0 when i pass those parameters to function.
#!/bin/bash -x
usage()
{
echo "In Usage Function"
echo $0
echo $1
echo $2
}
echo "printing first time"
echo $0
echo $1
echo $2
usage $0 $1 $2
Output: (2 Replies)
Discussion started by: Ariean
2 Replies
3. Shell Programming and Scripting
The objective of this function is to validate the file full path.
cat /dev/null > crontab_NOTEXISTS.txt
function File_Existence # Accepts 1 parameter
{
file_name="$(echo $1)"
echo "${file_name}"
&& break || echo "$file_name NOT FOUND" >> crontab_NOTEXISTS.txt
}
while read file_name... (7 Replies)
Discussion started by: aimy
7 Replies
4. 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
5. Shell Programming and Scripting
I have an for loop that reads the following file
cat param.cfg
val1:env1:opt1
val2:env2:opt2
val3:env3:opt3
val4:env4:opt4
.
.
The for loop extracts the each line of the file so that at any one point, the value of i is
val1:env1:opt1 etc...
I would like to extract each... (19 Replies)
Discussion started by: goddevil
19 Replies
6. Shell Programming and Scripting
Hi All,
I am new to shell scripting required some help in passing the parameter value to the shell script.
I am writing a shell script, in the script I have created two functions as below.
first function
get_trend_ids () {
Here I am connecting to the database and getting all the... (3 Replies)
Discussion started by: shruthidwh
3 Replies
7. Shell Programming and Scripting
Hi ,
I have three funcions f1, f2 and f3 .
f1 calls f2 and f2 calls f3 .
I have a global variable "period" which i want to pass to f3 .
Can i pass the variable directly in the definition of f3 ?
Pls help .
sars (4 Replies)
Discussion started by: sars
4 Replies
8. 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
9. UNIX for Dummies Questions & Answers
Hi,
I am trying to sum up numbered columns and in order to tidy up the program I have wrote a function to do the adding of some numbers. I have a problem though with passing a variable to the function in the UNIX bash shell. The function only gives the first number in the variable list and does... (4 Replies)
Discussion started by: Knotty
4 Replies
10. Shell Programming and Scripting
I need to pass a parameter to a function in a script. My parameter is a string. When I display the parameter within my function, I only get the first word from string I pass in.
How can I make the function receive the whole string (and not terminate at the first space it encounters)?.
part of... (1 Reply)
Discussion started by: fastgoon
1 Replies