LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   command runs at prompt not in script (https://www.linuxquestions.org/questions/linux-newbie-8/command-runs-at-prompt-not-in-script-280199/)

newbie_m 01-20-2005 03:02 PM

command runs at prompt not in script
 
Hi,

I would appreciate help with the following. It seems that when I run a
command from the command prompt the perl script (let's call this myperl.pl)works okay.

However, I would like to automate the process so can I put the command into a shell script (lets call this myshell.sh). The problem is it seems that the perl script starts to run but then hangs. This script is logging into and then supposed to load a database.

I don't think there is anything wrong with the perl script since I can call it from the command prompt. Also, I have used a shell script to run other perl scripts without problems. So I think I am able to call perl scripts properly.

I think perhaps the problem is that the command line is so long that it wraps to the next line when I am typing (there are a lot of different flags and paramters required to call this perl script). Could this be the cause are there some weird? newline characters being inserted that I can't see or is the cause something totally different?

thanks a bunch!

homey 01-20-2005 03:07 PM

Hi,
Automatic word wraping when you type doesn't insert a newline "\n" into the code. You could break up the line to make it easier for you to read......
this is a long \
line of code which \
goes on forever.

Might help if you let someone have a look at it.

newbie_m 01-20-2005 03:12 PM

Hi,

Thanks for your reply. If it's not the word wrapping then what could it be?
I have looked carefully at what I entered in the shell script and what I enter in the command prompt and it seems to be exactly the same thing. I can tell that the perl script starts to run since there is an echo or print line that executes properly but that's it. I suspected the word wrap because I thought perhaps since it had already
start running that perhaps some of the parameters were not being 'communicated'.

thanks!


All times are GMT -5. The time now is 02:17 AM.