Shell running with nohup not work, but with sh command yes..


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Shell running with nohup not work, but with sh command yes..
# 1  
Old 11-07-2012
Shell running with nohup not work, but with sh command yes..

why, when i run my shell with sh command it run without problem, but when run with nohup nombreshell.sh $ command not run correctly... values ​​obtained from database are not displayed in the csv file.

My shell do that:

1° data base access with sqlplus:
Code:
read_sql_stmt() {
typeset stmt=$1
typeset login=$2
echo "
set feedback off verify off heading off pagesize 0
$stmt;
exit
" | sqlplus -s $login

after, in the same shell script i use the function to obtain data
Code:
read_sql_stmt "select count(nros), categoria from tbl_nros_categoria_tmp where plan = 1 group by categoria" $CADENA_CONEXION | while
read var1 var2
do
        if [ $var2 = "CATEGORIA1" ]
        then
                let "a[1] = $var1"
        fi

        if [ $var2 = "CATEGORIA2" ]
        then
                let "a[2] = $var1"
        fi
done

and finally, i use data from array a[] to put on the csv file...

Code:
rm ../../files/result/resultadoCategorias.csv
echo "CATEGORIA1=${a[1]}" >> ../../files/result/resultadoCategorias.csv
echo "CATEGORIA2=${a[2]}" >> ../../files/result/resultadoCategorias.csv

thanks in advance... !!

PD: i use #!/bin/bash Smilie
# 2  
Old 11-07-2012
Are there any errors in the nohup.out file?
# 3  
Old 11-07-2012
Quote:
Originally Posted by rdrtx1
Are there any errors in the nohup.out file?
hi! thanks x your respose. there no errors in nohup.out file.
# 4  
Old 11-07-2012
try putting $CADENA_CONEXION in double quotes. Maybe there is a character that is creating another argument.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Programming

Shell copy command don't work

I want copy Files: But cp don't work: shell_exec("cp ".$pfad." ".$genzone); shell_exec("cp ../Chrysanthemum.jpg ../test"); Whats wrong? (3 Replies)
Discussion started by: Linuxmann
3 Replies

2. Shell Programming and Scripting

Running nohup command on remote server

I am having an issue in running a nohup command in a remote linux box from a linux box. Here are the details. Linux Machine 1: I have a script which starts a services and dumps the output into a log file. nohup sh weblogic.sh >> /home/log.out & I have placed the entire command in a... (2 Replies)
Discussion started by: accessbalaji
2 Replies

3. UNIX for Advanced & Expert Users

Running process in nohup

Hi All, I am facing issue in running a process in nohup. I ran a process in terminal since it is taking too long to complete I need to make it as background and nohup. I tried below and was able to make it in back ground 1. Cntrl + Z 2. bg I am using Korn Shell so disown is not working... (5 Replies)
Discussion started by: arunkumar_mca
5 Replies

4. UNIX for Dummies Questions & Answers

How to get a timestamp when running nohup & from a shell?

Hi, I am running nohup cp & in a shell script. How do I get a timestamp so I can get a timing of how long the copy took? Roughly, the script does something like below: date nohup cp -rp /files/source /files/target & date I am mainly wanting to know how long it took for the... (9 Replies)
Discussion started by: newbie_01
9 Replies

5. Shell Programming and Scripting

How to pause process running under nohup?

Hi ALL, Is there any way to pause a running process under nohup ? I have fired a build commands with required flags under nohup as below. now how can I pause the started build process. nohup make DEVICE=ap DEBUG=1 & I understand we can use ctrl + z to pause a foreground process... (3 Replies)
Discussion started by: useless79
3 Replies

6. UNIX for Dummies Questions & Answers

How to work command 'cd' in shell script?

I have simple script. like that, I am working on /usr/local/src and also under src folder there is a ft folder #!/bin/ksh #!/bin/bash dirpath="/usr/local/src/ft" echo $dirpath cd $dirpath echo displays ok "/usr/local/src/ft" but that doesn't enter "ft" folder. stays in current... (4 Replies)
Discussion started by: F@NTOM
4 Replies

7. Shell Programming and Scripting

Error while running script using nohup

Hi, I am running the below script. When i run the script normally it executes fine but when i run the same script using nohup it throws an error as getStatus.sh: syntax error at line 3: `(' unexpected . Can you let me know why it is so? while do . $(dirname $0)/include.sh cd... (2 Replies)
Discussion started by: vignesh53
2 Replies

8. AIX

Query on running script with nohup

Hi, I'm trying to run database restore script with the nohup command as it will run for long hours since if I run it normally, the putty session will become inactive and the restore gets terminated. The command I use is nohup db2 -tvf FBR_NODE0000.scr -z FBR_NODE0000.log & But the problem is... (2 Replies)
Discussion started by: vkcool.17
2 Replies

9. UNIX for Dummies Questions & Answers

more command does not work in bash shell

is there a different command to display contents of a file on the output in bash shell? i tried more and it does not work. (7 Replies)
Discussion started by: npatwardhan
7 Replies

10. Shell Programming and Scripting

nohup--how to make it work?

Hello gurus, I am facing an unusual problem while running nohup in shell scripts. i want to run two scripts simultaneously.In first script ,i take a backup of "nohup.out" & remove it .In second script,i state "nohup ./scriptname" but "nohup.out" is not getting generated ?? pls find attached... (1 Reply)
Discussion started by: abhijeetkul
1 Replies
Login or Register to Ask a Question