Download your favorite Linux distribution at LQ ISO.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
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!


  Search this Thread
Old 04-03-2005, 07:14 PM   #1
Registered: Jun 2004
Location: Montreal
Distribution: Red Hat 8
Posts: 120

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


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 ?

Old 04-03-2005, 07:28 PM   #2
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
Registered: Jun 2004
Location: Montreal
Distribution: Red Hat 8
Posts: 120

Original Poster
Rep: Reputation: 15
Unhappy Question


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


1) Is that of any importance ?

Old 04-05-2005, 02:20 PM   #4
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
Registered: Jun 2004
Location: Montreal
Distribution: Red Hat 8
Posts: 120

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


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 ?

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

Rep: Reputation: 30

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

Shell scripting? A nice tutorial for bash shell scripting is here:


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
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 > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 03:25 AM.

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