Sponsored Content
Full Discussion: c programming on vi
Top Forums Programming c programming on vi Post 13743 by S.P.Prasad on Wednesday 23rd of January 2002 03:34:58 AM
Old 01-23-2002
If u try this, it might work
1) Go to Command Mode By pressing ESC
2) Go to Ex Mode by pressing ":"
3) Issue the following command
:!gcc % -o <ObjFile> [-l library ] && ObjFile
or
:!gcc % [-l library ] && a.out

-o options lets u create a default object file instead of a.out. The first part of the command lets u compile C Code and the ('&&' ) the second part gets executed only when the first part exits with return status good. If so ,then 'ObjFile' will be created and the shell will execute the Object file else it will show u the errors and exit without executing the 'ObjFile'
 

10 More Discussions You Might Find Interesting

1. Programming

c programming or unix programming!?

i would like advice on the usbject of c programming (in the middle of reading a book on C). could i benefit more if i apply that knowledge in the unix format if i were able to, or would that take the point out of learning C, basically I want to stay away from strying too far away from unix and use... (1 Reply)
Discussion started by: moxxx68
1 Replies

2. Shell Programming and Scripting

Unix Systems Programming Vs Unix Programming

Several months ago I found a link that explained the difference between how a Unix Systems Admin would do scripting compared to what a Unix Programmer would do. It showed a basic script and then show several iterations that explained how the Systems Admin would change it to make it better. I was... (0 Replies)
Discussion started by: BCarlson
0 Replies

3. Programming

C++ programming

Sorry to ask this question here... where can I find a C++ programming thread? Thanks guys! (7 Replies)
Discussion started by: nadiamihu
7 Replies

4. Shell Programming and Scripting

New To Programming

Hello all!! I am new to programming, and to this forum. :D I am having sort of a problem. Me and my coworker are working on a code, both of us are stumped on a few things. One is we have a whole log file, i have found how to extract by column, but not by row. I need to extract by both.:confused:... (7 Replies)
Discussion started by: xkayla06
7 Replies

5. UNIX for Dummies Questions & Answers

Carreer:Networking Programming in Unix (C programming Language)

Hello, I am trying to learn Networking Programming in C in unix enviorment. I want to know how good it is to become a network programmer. i am crazy about Network programming but i also want to opt for the best carreer options. Anybody experienced Network Programmer, please tell me is my... (5 Replies)
Discussion started by: vibhory2j
5 Replies

6. Programming

programming in C

Hi Guys, I am willing to write some programs in C/C++ for Solaris machine. I am pretty good in C++ programming for PC. But I have some questions, while starting programming in solaris. 1. Which one is the most suitable & easy to use compiler? (Most probabaly I will use vi editor to edit... (4 Replies)
Discussion started by: Asteroid
4 Replies

7. Programming

C Programming - Hardware Programming

Can someone help me on suggesting some ways to access the memory content in RAM directly from C/C++ source code. Please provide me any book name or any URL so that I can get an exhaustive knowledge over it. If possible please give me some tips on interacting with hardwares directly through... (3 Replies)
Discussion started by: nandumishra
3 Replies

8. Shell Programming and Scripting

Sh programming

I have started writing one script. It is not taking the if block. Here is the script: #!/bin/sh set USER='/usr/ucb/whoami' ####################################################################### #Killing Process #######################################################################... (6 Replies)
Discussion started by: amarpreetka
6 Replies

9. UNIX for Dummies Questions & Answers

How does unix system administration, unix programming, unix network programming differ?

How does unix system administration, unix programming, unix network programming differ? Please help. (0 Replies)
Discussion started by: thulasidharan2k
0 Replies

10. UNIX for Dummies Questions & Answers

From iOS programming to Linux system programming

Hello. I like Linux and C programming language. Allways wanted to understand kernel and become a Linux system programmer. And I also like Objective-C and iOS. These two programming areas have relations: 1. Linux and iOS are UNIX-like systems, POSIX compliant. 2. It is useful to know C language... (2 Replies)
Discussion started by: Rockatansky
2 Replies
RAGG2-CC(1)						    BSD General Commands Manual 					       RAGG2-CC(1)

NAME
ragg2-cc -- CC frontend for compiling shellcodes SYNOPSIS
ragg2-cc [-a arch] [-b bits] [-k kernel] [-o file] [-dscxvh] DESCRIPTION
ragg2-cc is a frontend of CC. It is used to creates tiny binaries (1KB) or shellcodes in binary or hexpairs from a C source. The compiler used is the one configured by the CC environment. This has been tested with gcc, llvm-gcc and clang. Uses sflib (shellforge4) includes to get the syscall definitions. Only linux/darwin x86-32/64 is supported at the moment. Planned support for more architectures. OPTIONS
-a arch set architecture x86, arm -b bits 32 or 64 -k kernel windows, linux or osx -o file output file to write result of compilation -h show help message -v show version -d show assembler code -s generate assembly file -c generate compiled shellcode -x show hexpair bytes EXAMPLE
$ cat hi.c int main() { write (1, "Hello World ", 12); exit (0); } $ ragg2-cc hi.c hi.c.bin # Linked into a tiny binary. This is 294 bytes $ wc -c < hi.c.bin 294 $ ./hi.c.bin Hello World # The compiled shellcode has zeroes $ ragg2-cc -x hi.c e90000000083ec0ce800000000588d882a000000b804000000606a0651 6a0150cd8083c41061b8010000006a0050cd8083c40883c40cc368656c 6c6f0a00 # Use a xor encoder with key 32 to bypass $ ragg2 -e xor -c key=32 -B `ragg2-cc -x hi.c` 6a3e596a205be8ffffffffc15e4883c60d301e48ffc6e2f9c920202020 a3cc2cc82020202078ada80a2020209824202020404a26714a2170eda0 a3e4304198212020204a2070eda0a3e428a3e42ce348454c4c4f2a20 SEE ALSO
radare2(1), rahash2(1), rafind2(1), rabin2(1), rafind2(1), ranal2(1), radiff2(1), rasm2(1), ragg2cc(1), AUTHORS
pancake <pancake@nopcode.org> BSD
Dec 5, 2011 BSD
All times are GMT -4. The time now is 02:36 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy