Shell Programmer to Coder

Shell Programmer to Coder

Post by Jake Keit » Mon, 12 Jun 2000 04:00:00



I know that I am going to get rained on with "Find out for yourself"
but I'm going to ask anyway. I am an experienced shell programmer, but
I have come to the point where the only solution to what I want to do
is going to have to be coded and compiled to binary. I have very little
C experience. Where is a good place with a free C compiler or something
to start of with so I don't crash my server? Thanks

Sent via Deja.com http://www.deja.com/
Before you buy.

 
 
 

Shell Programmer to Coder

Post by Andy » Wed, 14 Jun 2000 04:00:00




Quote:> I know that I am going to get rained on with "Find out for yourself"
> but I'm going to ask anyway. I am an experienced shell programmer, but
> I have come to the point where the only solution to what I want to do
> is going to have to be coded and compiled to binary. I have very
little
> C experience. Where is a good place with a free C compiler or
something
> to start of with so I don't crash my server? Thanks

gcc is your friend! do your work as a regular user (i.e. not root)
and I doubt you'll break your server  :)

--
-Andy M
http://synecdoche.net/~andy

Sent via Deja.com http://www.deja.com/
Before you buy.

 
 
 

1. Beginner Shell programmer needs HELP (belonged on comp.unix.shell)

Jeff,

Your post was:

  >   I have a simple script that reads in two files that contain a list of variables
  >   and a list of values to assign to those variables. The script sorts them just
  >   fine. But where I run into a problem is in assigning the values to the
  >   variables. Here is the script
  >  
  >   #!/bin/sh
  >   OLD_PARAM=`cat $HOME/.genpad.prm | cut -d " " -f 3`
  >   ALL_VARS=`cat $HOME/.genpad.var | cut -d " " -f 2`
  >   COUNTA=1
  >   COUNTB=1
  >   for SET in `echo $ALL_VARS`
  >   do
  >   echo $COUNTA
  >   `echo $ALL_VARS | cut -d " " -f $COUNTA`=`echo $OLD_PARAM | cut -d "
  >   COUNTA=`expr $COUNTA + 1`
  >   COUNTB=`expr $COUNTB + 1`
  >   done
  >  
  >   I get the error "./genpad: G9_OBD2_IP=YES: not found"
  >   where the G9 is my variable and YES is the value I want assigned
  >   any suggestions would be greatly appreciated.
  >  
  >   Jeff S.

Try this interactively:
sh                  to start a Bourne shell
name=PIGLET         set a variable name
$name=EXPERIMENT     fails, right ?
exit

You can execute shell variable values  ( nextcommand=ls ) but
not set them as variables.

Since in this case you were reading them from a file why not
put VAR1=VAL1 etc on lines in one file and then execute that ?

For the Bourne shell the command is "."  
. set_my_vars_file

or in the C-shell it is "source".

And nawk has associative arrays that I use at times like this.

Future shell (as opposed to C)  questions to comp.unix shell please.
Hope this helps.


2. Integrating Unix & DOS 'make' environment?

3. Informix-4GL, C, Unix and shell script programmers

4. comp.unix.questions

5. JOB EMPLOYMENT for Game Programmer, Utility Programmer for Nintendo 64 and Sony Playstation

6. .openwin-init doesn't work

7. an easy one for shell programmers:

8. Rdist, avoiding certain directories

9. Why can't I post to comp.unix.shell, comp.unix.programmer?

10. ********Unix SHell Programmers*****************

11. Beginner Shell programmer needs HELP

12. WANTED: Shell, Perl, C, and/or Java Programmer

13. Novice shell programmer file filtering question