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)
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)
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)
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)
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)
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)
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)
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)
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)
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
LEARN ABOUT CENTOS
igawk
IGAWK(1) Utility Commands IGAWK(1)NAME
igawk - gawk with include files
SYNOPSIS
igawk [ all gawk options ] -f program-file [ -- ] file ...
igawk [ all gawk options ] [ -- ] program-text file ...
DESCRIPTION
Igawk is a simple shell script that adds the ability to have ``include files'' to gawk(1).
AWK programs for igawk are the same as for gawk, except that, in addition, you may have lines like
@include getopt.awk
in your program to include the file getopt.awk from either the current directory or one of the other directories in the search path.
OPTIONS
See gawk(1) for a full description of the AWK language and the options that gawk supports.
EXAMPLES
cat << EOF > test.awk
@include getopt.awk
BEGIN {
while (getopt(ARGC, ARGV, "am:q") != -1)
...
}
EOF
igawk -f test.awk
SEE ALSO gawk(1)
Effective AWK Programming, Edition 1.0, published by the Free Software Foundation, 1995.
AUTHOR
Arnold Robbins (arnold@skeeve.com).
Free Software Foundation Nov 3 1999 IGAWK(1)