10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
I'm reading a text file using a while loop but when I call a function from within this loop it exits that same iteration … even though there are many more lines in the file to be read.
I thought it was something to do with the IFS setting but it appears that a function call (when run... (3 Replies)
Discussion started by: user052009
3 Replies
2. Shell Programming and Scripting
I wrote a very simple script to understand how to call user-defined functions from within awk after reading this post.
function my_func_local {
echo "In func $1"
}
export -f my_func_local
echo $1 | awk -F"/" '{for (k=1;k<=NF;k++) {
if ($k == "a" ) {
system("my_local_func $k")
}
else{... (19 Replies)
Discussion started by: sreyan32
19 Replies
3. Shell Programming and Scripting
I have a bash script with some functions as below and am wondering if I can use the variables declared in setup in the other functions and in the rest of the bash script.
setup(){
none=0; low=1; medium=2; high=3; debug=4
var1="red"
var2="fred"
}
create_basemap() {
... (7 Replies)
Discussion started by: kristinu
7 Replies
4. Shell Programming and Scripting
can somebody telll me what my values are not being displayed in the function func1()
{oracle@im4s012nz1_DUMMY}$ cat x1.ksh
#!/bin/ksh
getpwd()
(
set -x
. /home/oracle/dba/bin/CyberArk/CyberArk_GetPass.ksh
ORA_USER=$DB_UID
ORA_PWD=$DB_PWD
echo "Here I am 1... (6 Replies)
Discussion started by: BeefStu
6 Replies
5. Shell Programming and Scripting
Hello
I have a text file with the next pattern
Name,Year,Grade1,Grade2,Grade3
Name,Year,Grade1,Grade2,Grade3
Name,Year,Grade1,Grade2,Grade3
I want to assign to external variables the grades using the awk method.
After i read the file line by line in order to get the grades i use this
... (2 Replies)
Discussion started by: Spleshmen
2 Replies
6. Shell Programming and Scripting
Hi all,
I'm trying to import some functions I have saved in a file named
functions.sh into a different script (protocol.sh). Can anybody show
me how to do this? I tried source functions.sh as I would do at the
terminal but source command cannot be found from within the script
protocol.sh.
... (2 Replies)
Discussion started by: tevang
2 Replies
7. Shell Programming and Scripting
Hello all,
Problem.
----------
I'm trying to reassign a referenced variable passed to a 'local'
variable in a function but the local variable refuses to be assigned
the content of the referenced variable.
Any ideas would be appreciated.
Objective.
-----------
Eliminate all $VAR... (1 Reply)
Discussion started by: ASGR
1 Replies
8. Programming
Hi,
In the course of my script i have to compare SYSDATE with the 15th of the current month:
if it is greater than i should set a variable date to 15th of the next month
if less than i should set it to the 15th of the current month.
In other words the question is how to set a date variable... (2 Replies)
Discussion started by: fmina
2 Replies
9. Shell Programming and Scripting
Hi All,
I have the following problem:
1. I have a file containing a line:
a,b,d,${d},e,f
2. From within a script I grep the file for '^a,' to get the line
3. I obtain the fourth field as follows:
Field4="$( print -r $fileEntry | cut -d, -f4 )"
4. The script exports variables at the... (1 Reply)
Discussion started by: oneillc9
1 Replies
10. Shell Programming and Scripting
I have a script that ultimately will FTP data to certain directories based on a character in the filename. I am creating a function within my script to handle the FTP call. Are the variables that are setup in the original script accessible to the function? If not, is there a way to allow them to... (4 Replies)
Discussion started by: dfb500
4 Replies