In the below bash the function execute is started with the while true at the end of the script. Currently, this works and processing does begin. The function panel in bold does not get called after execute completes, therefore the user does not get the menu selection and the files just loop overwritten each other. That is if there are 4 files to be processed, only the first gets processed then it gets caught in a loop and overwrites and 2,3,4 never even start. It seems like panel not being called is what the issue is, but I am not sure why its not being called. The .... are additional lines in the script. Thank you .
Bash
Last edited by cmccabe; 05-27-2017 at 12:18 PM..
Reason: fixed format
I'm not sure if this is a rule. But I generally write the functions before i call them. Can you try putting panel() before execute() and run your code.
These 2 Users Gave Thanks to balajesuri For This Post:
Location: Saint Paul, MN USA / BSD, CentOS, Debian, OS X, Solaris
Posts: 2,288
Thanks Given: 430
Thanked 480 Times in 395 Posts
Hi.
Quote:
Originally Posted by balajesuri
I'm not sure if this is a rule. But I generally write the functions before i call them. Can you try putting panel() before execute() and run your code.
I didn't look at the entire code, but it seems to be a rule in bash, ksh, zsh, and dash:
producing:
Good catch balajesuri !
Best wishes ... cheers, drl
Last edited by drl; 05-28-2017 at 10:28 AM..
Reason: Minor emphasis added.
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)
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)
Hello All,
I am automating a task using bash script and got stuck at this. From the below input,
Meta Device Members (20) :
{
----------------------------------------------------------------------
BCV DATA RDF DATA ... (7 Replies)
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)
Hi I making a shell script and have some problem to start a function.
echo "chose a number to download"
read i;
case $i in
1) head -1 ~/test3 | tail -1 > ~/test4;;
2) head -2 ~/test3 | tail -1 > ~/test4;;
3) head -3 ~/test3 | tail -1 >... (9 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)
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)
i just finished a project for a c++ class that i wrote at home on my computer, compiled with gcc. when i brought the code into school it would not compile, it would complain that cannot call main() function. at school we use ancient borland c++ from 1995. anyway my program has 20 different... (3 Replies)