LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 01-20-2005, 02:02 PM   #1
newbie_m
LQ Newbie
 
Registered: Dec 2004
Posts: 6

Rep: Reputation: 0
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!
 
Old 01-20-2005, 02:07 PM   #2
homey
Senior Member
 
Registered: Oct 2003
Posts: 3,057

Rep: Reputation: 61
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.
 
Old 01-20-2005, 02:12 PM   #3
newbie_m
LQ Newbie
 
Registered: Dec 2004
Posts: 6

Original Poster
Rep: Reputation: 0
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!
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Key stroke/command to shut down x and go into the command prompt screen? Fear58 Linux - General 1 07-14-2004 07:14 PM
creating shell script that executes as root regardless of who runs the script? m3kgt Linux - General 13 06-04-2004 10:23 PM
script runs fine from a command line, but doesn't work from cron? kleptophobiac Linux - Software 5 05-03-2004 04:14 PM
Where can I the script that runs the forum? patpawlowski LQ Suggestions & Feedback 5 03-17-2004 04:37 PM
a script that runs every 5 minutes? zovres Linux - Newbie 5 08-19-2003 12:14 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 10:35 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration