PDA

View Full Version : how can i write shell script with c


shanyx
March 4th, 2008, 06:45 AM
how can i use c language in ubuntu shell script. is it possible to run c code in shell script. and i need to know how to convert Ascii code to character with shell script code. i know how to do it in c language.

ghostdog74
March 4th, 2008, 10:48 AM
c language is c language. shell script is shell script. What exactly are you trying to do?

ruy_lopez
March 4th, 2008, 11:19 AM
echo -e "\043"

prints ascii character 35 (\043 is 35 in octal).

Or capture into a variable:

var=`echo -e "\043"`
echo $var
./test.sh
#

pedro_orange
March 4th, 2008, 12:05 PM
You can run shell commands from a c application using the:

system("ps -C pedro_orange")

Or, do you mean a C program to generate a .sh file?