LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
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 04-03-2005, 07:14 PM   #1
ptreves
Member
 
Registered: Jun 2004
Location: Montreal
Distribution: Red Hat 8
Posts: 120

Rep: Reputation: 15
Unhappy First time writing a Linux Script !!!!


Hello,

I want to write a Linux script that will automatically recompile my source code files and rename the compiled files to lower case.

For this, I have written a small script file called gen_Katz.csh and through the chmod command made the sript file executable.

I used Linux mv commands to rename the compiled files and some special Oracle Linux commands to compile my source file.

1) Beyond this is there anything else that I should include in my Linux script file to make sure that it will run properly ?

Paolo
 
Old 04-03-2005, 07:28 PM   #2
heema
Senior Member
 
Registered: Sep 2003
Location: Egypt
Distribution: Arch
Posts: 1,528

Rep: Reputation: 47
it didn't run ?

did it make any errors ?

sorry but your question is a little bit vague
 
Old 04-05-2005, 01:56 PM   #3
ptreves
Member
 
Registered: Jun 2004
Location: Montreal
Distribution: Red Hat 8
Posts: 120

Original Poster
Rep: Reputation: 15
Unhappy Question

Hello,

I did not try to run the script yet.
However, looking at another Linux Script, I noticed that the first line in the script contains a line like

#bin csh

something....

1) Is that of any importance ?

PT
 
Old 04-05-2005, 02:20 PM   #4
enemorales
Member
 
Registered: Jul 2004
Location: Santiago, Chile
Distribution: Ubuntu
Posts: 410

Rep: Reputation: 31
It is of importance, and probably was something like: #!/bin/csh

That says which shell will run the script. For instance, I would put "#!/bin/bash" because I use bash.

Anyway, maybe you should look at the "make" utility. This is what is usually used to compile. It works by creating a "Makefile" that contains the dependencies and the compilation commands to solve them.. It is better than a script, because it is able to check which sources have changed and compile only those ones.
 
Old 04-06-2005, 01:12 PM   #5
ptreves
Member
 
Registered: Jun 2004
Location: Montreal
Distribution: Red Hat 8
Posts: 120

Original Poster
Rep: Reputation: 15
Unhappy 2 plateforms: Windows / Linux

Hello,

I my case the development environment is a WIndows XP Pro and the production environment is Linux Red Hat.

I take the source files under windows through FTP on my Linux box to be recompiled. I am thinking of writing a Linux script that would take all the source files and recompile them automatically.

Suggestions ?

PT
 
Old 04-06-2005, 03:22 PM   #6
dping
Member
 
Registered: Dec 2004
Location: Oregon, USA
Distribution: Kubuntu 9.04
Posts: 181

Rep: Reputation: 30
make

make is the standard linux tool for [semi]automatic compilation.

Shell scripting? A nice tutorial for bash shell scripting is here:
http://www.tldp.org/LDP/abs/html/
 
  


Reply



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
writing a script to do linux taskes.. kevinm2 Linux - Software 3 06-17-2005 01:49 PM
help writing script willinusf Programming 7 07-20-2004 11:37 AM
Help writing a rm script VisionZ Linux - Newbie 17 03-24-2004 07:15 AM
Writing script for Linux robbmcmahan Programming 3 09-10-2003 02:05 PM
PHP last time modified script time way off GabeF Programming 2 11-05-2002 08:05 PM

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

All times are GMT -5. The time now is 07:45 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