Hi,
I am pretty new to unix.
Lets say i have a program(run_program) that will call another file function(functiona, in same directory):
hence, inside that run_program. i will just call "functiona xx xx" to refer and use that function. this run ok until i run this program from another folder.... (3 Replies)
I have created a file generic.func and it has lots of functions. One of the functions is this:
Check_backup_size()
{
dsmc q b $BACKUP_DIR/"*.Z" | awk '{print $1}'|sed 's///g' > outputfile
X=`awk '{sum += $1} END {print sum }' outputfile'`
echo "$X"
ls -ltr $BACKUP_DIR/"*.Z" | awk... (5 Replies)
This may sounds dumb, but can I call on a function from a file? For example, I have a function file full of functions like below (no shell designation):
func { echo "blah blah blah 1" }
func2 { echo "blah blah blah 2" }
func3 { echo "blah blah blah 3" }
Am I able to call on any one... (3 Replies)
Hi,
I had a scripts which calls two function. One function will call another function, script is working fine but the second function is not calling the first function. Below is the script
#!/usr/bin/ksh
fun1() {
echo $DATETIME >> Test1.ksh
return 0
}
fun2() {
typeset DATETIME=`date... (5 Replies)
This is my function which is creating three variables based on counter & writing these variable to database by calling another function writeRecord
but only one record is getting wrote in DB.... Please advise ASAP...:confused:
function InsertFtg
{
FTGSTR=""
echo "Saurabh is GREAT $#"
let... (2 Replies)
Hey guys,
I got a little problem with calling variables in my case
This is a simple version of my script:
var1=1
var2=2
while
do
case $1 in
"a")
var1=$var2;
echo "1";
echo "var1: $var1";
echo "var2: $var2";;
"b")
var2=5;
echo "2"; (1 Reply)
Hi,
I need to run start_load function for two tables.
Step 1: if HMAX_TBL_ID and GMAX_TBLI_D are same for tab_name1 then echo message "all table ids are processed"
Step 2: go back and call start_load for tab_name2 and check if table id are same for table 2 too.
Please let me know how to... (5 Replies)
In my prog if i enter the input for the 1st time it is executing correctly,
but for the second time entire script is not executing it just exiting
my code is
#!/bin/sh
checkpo()
{
echo "Checking the entered PO to create output text file ";
IFS=$'\n'
set -f
var=0
for i in $(cat... (3 Replies)
I have a script which does gunzip, zip and untar.
Input to the script is file name and file directory (where file is located)
I am reading the input parameters as follows:
FILENAME=$1
FILEDIR=$2
I have created 3 functions that are as follows:
1) gunzip file
2) unzip file... (2 Replies)