LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   First time writing a Linux Script !!!! (https://www.linuxquestions.org/questions/linux-newbie-8/first-time-writing-a-linux-script-309390/)

ptreves 04-03-2005 07:14 PM

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

heema 04-03-2005 07:28 PM

it didn't run ?

did it make any errors ?

sorry but your question is a little bit vague

ptreves 04-05-2005 01:56 PM

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

enemorales 04-05-2005 02:20 PM

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.

ptreves 04-06-2005 01:12 PM

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

dping 04-06-2005 03:22 PM

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/


All times are GMT -5. The time now is 11:46 PM.