Sponsored Content
Full Discussion: Compilation
Top Forums Shell Programming and Scripting Compilation Post 302459855 by wpeckham on Tuesday 5th of October 2010 01:18:28 PM
Old 10-05-2010
Compile shell script?

In answer to that question, there is no DIRECT way to compile a shell script. There ARE ways to PACKAGE a shell script, but to truly COMPILE a shell script? None that I know of.

My own methods start with: "first translate the shell script into C, FORTRAN, ADA, or Pascal, then...".

The entire reason for using a shell script instead of assembler, C, Pascal, etc is that it is easy and natural to call utilities, pipe processes, and replicate the commands you would use to perform the same functions manually from the command-line. If you need a compiled program, then you really need to translate the process into something that is somewhat self-sufficient and does not require those external utilities, the shell, or anything but the resources of the executable environment.

Pick a language, but not at random. Examine what your script does, and consider the available compilers in terms of which language implementation answers you need in the most elegant, natural fashion. Design your project with the script functions and this language in mind. When it looks complete (a peer overview may be useful at this point) you can decide on some coding standards and get to the fun part: coding.

You will find the process somewhat slower and more complex, but potentially far more rewarding, compared to scripting.

I would almost bet, however, that compiling is terrible overkill and an inefficient use of resources in answer to your real need.
Can you elaborate a bit on the situation that prompted your question?

Last edited by wpeckham; 10-05-2010 at 02:30 PM..
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Kernel compilation

I have re-compiled kernel source code available in /usr/src/linux.2.4.20 with "make" command. The compilation is succesful. Now the problem is create the image for this. The documentation in the same folder says that now you have compile "make image". There is no option for image in Makefile. ... (3 Replies)
Discussion started by: mankrish
3 Replies

2. Solaris

compilation problem

I am compiling a software named wine When i run make then at the end following error generated. DVAPI32_ -foversion.res version.rc ld.so.1: ../../tools/wrc/wrc: fatal: relocation error: file ../../tools/wrc/wrc: symbol wine_casemap_upper: referenced symbol not found *** Signal 9 make:... (0 Replies)
Discussion started by: mansoorulhaq
0 Replies

3. Programming

Compilation error

I am compiling a software xchm on solaris 10. First i run './configure' There is no error. But when i start compiling using 'gmake' following error shown /usr/local/include/wx-2.6/wx/x11/brush.h: In copy constructor `wxBrush::wxBrush(const wxBrush&)':... (3 Replies)
Discussion started by: mansoorulhaq
3 Replies

4. Programming

compilation problem

i have a class name 1.c in tht i am using function n wich has his body in 2.c and declaration in 2.h now how can i compile 1.c. ex; 1.c int main() { //some data n(10); //somedata } ***** 2.c int n(int k) { //some data } int main() { some data (2 Replies)
Discussion started by: phani_sree
2 Replies

5. Programming

c compilation process

What is symbol table? (1 Reply)
Discussion started by: rangaswamy
1 Replies

6. Linux

c++ compilation error

Hello every one, here i am attempting to compile a c++ module using gcc.it is throwing a error . error: ==== > make -S dummyCHARGP /usr/local/bin/gcc -g -DDEBUG -DMAT -I. -I/swtemp/usbs/cc/unix-ce/root/subsys/lib/Linux/ -I/opt/dce/include -I/opt/dce/include/dce ... (12 Replies)
Discussion started by: mannam srinivas
12 Replies

7. UNIX for Dummies Questions & Answers

Compilation

Hi All, We have a C program existing in one of the folders which I have to modify a lil bit, When I'm trying to compile the program using GCC or CC command its showing as ksh: gcc: not found is that mean there is no compiler or do I have to verify for something, please advice Thank... (2 Replies)
Discussion started by: diggermf
2 Replies

8. Programming

C Compilation problem

Dear all I am new to C programming In response to the post cat get_time.c #include <stdlib.h> #include <sys/time.h> main() { struct timeval tv; struct timezone tz; struct tm *tm; gettimeofday(&tv, &tz); tm=localtime(&tv.tv_sec); printf("... (2 Replies)
Discussion started by: on9west
2 Replies

9. AIX

Problem in compilation.

Hi, I am executing the below mentioned code:- proc SQLCHECK=SEMANTICS iname=CDBInteractor.pc parse=none code=cpp cpp_suffix=cpp g++ -c main.cpp g++ -o pre_request_engine main.o -I/oracle/oracle/app/product/10g/precomp -L/oracle/oracle/app/product/10g/lib32 -lnsl -ldl And... (2 Replies)
Discussion started by: tushar_tus
2 Replies

10. AIX

VIM compilation

Hi, I tried to compile vim on AIX OS. I tried all version from 6.4 to 7.2 and the effect is the same. ./configuration --prefix=/home/me OK make The make try to compile first file buffer.c ane it gived me message like this gcc -c -I. -Iproto -DHAVE_CONFIG_H -DFEAT_GUI_ATHENA ... (2 Replies)
Discussion started by: marcintom.aviva
2 Replies
GLCOMPILESHADER(3G)						  [FIXME: manual]					       GLCOMPILESHADER(3G)

NAME
glCompileShader - Compiles a shader object C SPECIFICATION
void glCompileShader(GLuint shader); PARAMETERS
shader Specifies the shader object to be compiled. DESCRIPTION
glCompileShader compiles the source code strings that have been stored in the shader object specified by shader. The compilation status will be stored as part of the shader object's state. This value will be set to GL_TRUE if the shader was compiled without errors and is ready for use, and GL_FALSE otherwise. It can be queried by calling glGetShader() with arguments shader and GL_COMPILE_STATUS. Compilation of a shader can fail for a number of reasons as specified by the OpenGL Shading Language Specification. Whether or not the compilation was successful, information about the compilation can be obtained from the shader object's information log by calling glGetShaderInfoLog(). ERRORS
GL_INVALID_VALUE is generated if shader is not a value generated by OpenGL. GL_INVALID_OPERATION is generated if shader is not a shader object. ASSOCIATED GETS
glGetShaderInfoLog() with argument shader glGetShader() with arguments shader and GL_COMPILE_STATUS glIsShader() SEE ALSO
glCreateShader(), glLinkProgram(), glShaderSource() COPYRIGHT
Copyright (C) 2003-2005 3Dlabs Inc. Ltd. This material may be distributed subject to the terms and conditions set forth in the Open Publication License, v 1.0, 8 June 1999. http://opencontent.org/openpub/. [FIXME: source] 05/30/2012 GLCOMPILESHADER(3G)
All times are GMT -4. The time now is 12:33 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy