D&C GLug - Home Page

[ Date Index ] [ Thread Index ] [ <= Previous by date / thread ] [ Next by date / thread => ]

[LUG] shell programming continuued

 

Hi

I managed to fix this script a little more, however it's still not really working properly, I know to read back user input from read name I use $name
what I need to do is to take a source file file.c and compile it into a working program so far I have got about 1/2 way there, after all this works I can tidy the script up a little (looks terrible at the moment)


anyway it seems fairly happy with the first part, however I am unsure how to pass the output from cc -c file.c to as a second argument to cc -o

can someone help please

thanks

paul

/#/bin/bash/
*echo* "please enter file name (source):"
*read* name
/#compile user specified c source file in to a object file (file.o)/
*cc* -c $name *ls* -l
*echo* "please enter filename (final binary name):"
*read* binary
/#compile object code into final binary - binary objectname.o/
*cc* -o $binary $binary.o
/#display long directory listings, with file permissions displayed, /
/#ls -l $name $binary/



-- The Mailing List for the Devon & Cornwall LUG Mail majordomo@xxxxxxxxxxxxx with "unsubscribe list" in the message body to unsubscribe. FAQ: www.dcglug.org.uk/linux_adm/list-faq.html