Sponsored Content
Top Forums Shell Programming and Scripting How to call the c library created by shc Post 302180545 by alfredo on Monday 31st of March 2008 12:20:54 PM
Old 03-31-2008
How to call the c library created by shc

I have written a shell script called square, which prints the square of the input number, eg.

> square 4
16

There is a program called shc which compiles the shell scirpt and create a executable file and a c library file, namely square.x and square.x.c repectively.

If I would like to include square.x.c in another c script, such that the c script can use this square function. Then, how can I call the function in the c script?
Should I use square 4 or square(4) ?

PS: Perhaps, square can be done by common c function, but actually this is an example, I just want to know how to call the shc-compiled function in c script.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

shc: shell compiler?

Has anyone ever gotten shc compiler program to work. I am trying to encrypt a bash script on centos. When I run the command "shc -f test.sh", the binary actually gets created; however, when I try to run the binary I get the following the error: # ./test.sh.x ./test.sh.x: No such file or... (1 Reply)
Discussion started by: cstovall
1 Replies

2. Shell Programming and Scripting

tcsh user failed to call library in ksh program

Hi folks, I'm trying to organize functions in my ksh program into libraries. If I run my program as any ksh user it will succeed. Only when I run my program as tcsh user (i.e oracle) I failed. Example ======= The ksh code: tornado:/tmp # cat nir.ksh #! /bin/ksh cdromPath=`pwd`... (1 Reply)
Discussion started by: nir_s
1 Replies

3. UNIX for Advanced & Expert Users

how to differentiate system call from library call

Hi, Ho do I differentiate system call from library call? for example if I am using chmod , how do I find out if it is a system call or library call? Thanks Muru (2 Replies)
Discussion started by: muru
2 Replies

4. Programming

How to call the c library created by shc

I have written a shell script called square, which prints the square of the input number, eg. > square 4 16 There is a program called shc which compiles the shell scirpt and create a executable file and a c library file, namely square.x and square.x.c repectively. If I would like to... (1 Reply)
Discussion started by: alfredo
1 Replies

5. Shell Programming and Scripting

Problems using shc

Hi all! First of all, sorry for my poor english :-S Well, I have some scripts in a SuSe server to encrypt... but all them must still working when I encrypt it, ok? About the server, I have root access: # id uid=0(root) gid=0(root) groups=0(root) # uname -a Linux servername... (4 Replies)
Discussion started by: Magius
4 Replies

6. Shell Programming and Scripting

Help with shc

Hi all, I'm trying to install shc on my clean solaris 10 so that I could do some encrypting on my shell scripts. I've tried several ways but it gave me these error messages # make cc -Wall -O6 shc.c -o shc cc: illegal option -Wall *** Error code 1 make: Fatal error: Command failed... (6 Replies)
Discussion started by: solarisnoob
6 Replies

7. Shell Programming and Scripting

Need help - shc

I have two scripts test1.sh and test2.sh. test1.sh is calling test2.sh. test2.sh is having some functions and password which we are using in test1.sh test1.sh #!/bin/sh . test2.sh echo "$test"test2.sh #!/bin/sh test=pravinO/P pravin Now use shc to protect my test2.sh and i modified... (5 Replies)
Discussion started by: pravin27
5 Replies

8. Shell Programming and Scripting

shc compiler issue

I am using the shc shell compiler, it works fine, just that when i execute it, it displays the code at the terminal. Is there any way to hide this as well? otherwise it beats the purpose of hiding the code. Thanks ! (7 Replies)
Discussion started by: ysvsr1
7 Replies

9. Shell Programming and Scripting

SHC Cron help-me

Hello, I have some shellscripts internal company more by the need to conceal the code to protect passwords and others, we are using the SHC. the shellscripts always worked without error, including cron. after the SHC, if I run manually (. / shellscript) it works if I put the same command... (3 Replies)
Discussion started by: c0i0t3
3 Replies

10. UNIX for Dummies Questions & Answers

Shc on SUN 5.10 SPARC

Hello, I would like to use shc on SUN 5.10 SPARC and HP UX Itanium 11.31 so that I could do some encrypting on my shell scripts. But on these machines I don"t have cc or gcc. I find a man who can download shc.c and send me the binary files. You can download it here : www datsi fi upm es... (3 Replies)
Discussion started by: peg
3 Replies
mkgeo_ugrid(1rheolef)						    rheolef-6.1 					     mkgeo_ugrid(1rheolef)

NAME
mkgeo_ugrid -- build an unstructured mesh of a parallelotope, in 1d, 2d or 3d SYNOPSIS
mkgeo_ugrid options [n] EXAMPLE
The following command build a triangle based 2d unstructured mesh of the unit square: mkgeo_ugrid -t 10 > square-10.geo geo -mayavi square-10.geo or in one comand line: mkgeo_ugrid -t 10 | geo -mayavi - DESCRIPTION
This command is usefull when testing programs on simple geometries. Invocation is similar to mkgeo_grid (see mkgeo_grid(1)). It calls gmsh as unstructured mesh generator. It avoid the preparation of an input file for a mesh generator. The optional n argument is an inte- ger that specifies the subdivision in each direction. By default n=10. The mesh files goes on standard output. The command supports all the possible element types: edges, triangles, rectangles, tetraedra, prisms and hexahedra. It supports also mixed 2D with triangles and quadrangles: mkgeo_ugrid -tq 10 | geo -mayavi - and mixed 3D with tetraedra, prisms and/or hjexaedra: mkgeo_ugrid -TP 10 | geo -mayavi - mkgeo_ugrid -PH 10 | geo -mayavi - mkgeo_ugrid -TPH 10 | geo -mayavi - ELEMENT TYPE OPTIONS
-e 1d mesh using edges. -t 2d mesh using triangles. -q 2d mesh using quadrangles. -tq 2d mesh using both triangles and quadrangles. -T 3d mesh using tetraedra. -P 3d mesh using prisms. -H 3d mesh using hexahedra. -TP -PH -TPH 3d mesh using a mixt between tetraedra, prisms and/or hexahedra. THE GEOMETRY
The geometry can be any [a,b] segment, [a,b]x[c,d] rectangle or [a,b]x[c,d]x[f,g] parallelotope. By default a=c=f=0 and b=d=g=1, thus, the unit boxes are considered. For instance, the following command meshes the [-2,2]x[-1.5, 1.5] rectangle: mkgeo_ugrid -t 10 -a -2 -b 2 -c -1.5 -d 1.5 | geo - -a float -b float -c float -d float -f float -g float BOUNDARY DOMAINS
-sides -nosides The boundary sides are representd by domains: left, right, top, bottom,front and back. -boundary -noboundary This option defines a domain named boundary that groups all sides. By default, both sides and the whole boundary are defined as domains: mkgeo_ugrid -t 10 > square.geo geo square.geo mkgeo_ugrid -t 10 -nosides > square.geo geo square.geo mkgeo_ugrid -t 10 -noboundary > square.geo geo square.geo mkgeo_ugrid -t 10 -noboundary -nosides > square.geo geo square.geo REGIONS
-region -noregion The whole domain is splitted into two subdomains: east and west, This option is used for testing computations with subdomains (e.g. transmission problem; see the user manual). mkgeo_ugrid -t 10 -region | geo - CORNERS
-corner -nocorner The corners (four in 2D and eight in 3D) are defined as OD-domains. This could be usefull for some special boundary conditions. mkgeo_ugrid -t 10 -corner | geo - mkgeo_ugrid -T 5 -corner | geo - THE MESH ORDER
-order int The polynomial approximation mesh order, as defined by gmsh. This option enable a possible curved boundary, when applying a suit- able nonlinear transformation to the mesh. Defualt is order=1. OTHERS OPTIONS
-clean clear temporary files (this is the default). -noclean does not clear temporary files. SEE ALSO
mkgeo_grid(1) rheolef-6.1 rheolef-6.1 mkgeo_ugrid(1rheolef)
All times are GMT -4. The time now is 05:57 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy