Sponsored Content
Top Forums Shell Programming and Scripting Surrounding a chunk of code by #ifdef and #endif Post 302116879 by xxxaxa on Wednesday 9th of May 2007 06:46:37 AM
Old 05-09-2007
MMmmm, thanks!!! I'll try to make this work for me Smilie

Last edited by xxxaxa; 05-09-2007 at 07:56 AM..
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

How can you show lines surrounding a search string?

I would like to be able to grep (or some such thing) a search argument and then display the line plus the preceding 3 lines of the file and the following 3 lines of the file. Any ideas? Thanks in advance! :D (3 Replies)
Discussion started by: robster
3 Replies

2. Linux

how to enable #ifdef macro in the command line of make?

Linux, C++, make, macro In source code, we used some #ifdef macros. How can I enable #ifdef macro in the command line of "make" (NOTE: I do NOT want to change source code or makefile to define that macro from time to time). e.g. test.cpp: ... #ifdef TEST1 // code segment for test1 ...... (3 Replies)
Discussion started by: princelinux
3 Replies

3. Shell Programming and Scripting

how to get surrounding lines of grep result

hi, if i have a file and i want to search for the word error using grep, i usually want to see the surrounding lines too as they contain info about the error. what would be a nice way to achieve this? thanks (6 Replies)
Discussion started by: JamesByars
6 Replies

4. UNIX for Advanced & Expert Users

then: then/endif not found

Hi All I am getting this error when i try to run script from root using other user profile. Command I am running is "su - user -c command" Error envounterd "then: then/endif not found" Can any body please help me on this ... (4 Replies)
Discussion started by: asadlone
4 Replies

5. Shell Programming and Scripting

how to get surrounding lines of my grep search?

hi, if I grep a file, sometimes I want to see as an eg 2 lines above and below my grep results. how can this be done thanks (3 Replies)
Discussion started by: JamesByars
3 Replies

6. Shell Programming and Scripting

if else endif using csh

I am trying to use csh to do an if statement as below if ( $tmaxf2 > $tmaxf1 ) then set tmax = $tmaxf2 else set tmax = $tmaxf1 endif Does not work and I'm getting if: Badly formed number. (0 Replies)
Discussion started by: kristinu
0 Replies

7. UNIX for Advanced & Expert Users

chunk server implementation

How unix file can be put in the hash table and how to write a program in which the chunk server acts as a client and server . Can you give me a comprehensive idea of implementation. (0 Replies)
Discussion started by: kswapnadevi
0 Replies

8. Shell Programming and Scripting

Possible to grep string based on surrounding strings?

I was wondering if it was possible to grep a pattern based on the surround text. For example, if i have an input file like this: titleA titleB titlex titleC titleD titlex titleE And I want to grep "title" and save the results only if it is not followed with a "titlex". My output... (14 Replies)
Discussion started by: jl487
14 Replies

9. Shell Programming and Scripting

How to use ifdef for bash variables in csh environment?

Hi Guys, I have a a bash script and i am exporting a variable in it. I am calling a csh script from this bash script. The variable "ABC" will be visible in csh script. ks.bash export ABC = abc ./kp.csh ab.csh echo $ABC setenv ABC =cde (i want to assign this value to ABC only if... (4 Replies)
Discussion started by: vdhingra123
4 Replies

10. Shell Programming and Scripting

Grep pattern only and surrounding lines

Hello, I am trying to grep search a pattern and a line before it. cat input >record1 hello1hello2hellonhello3 >record2 helloohello1hello2hello3 When I use, grep with -o option and either of -A/B/C options, I still can't see lines before or after the pattern. But the exact pattern is... (5 Replies)
Discussion started by: jacobs.smith
5 Replies
TYPES(5)						      BSD File Formats Manual							  TYPES(5)

NAME
types -- system data types SYNOPSIS
#include <sys/types.h> DESCRIPTION
The file sys/types.h contains the defined data types used in the kernel (most are used through out the system). #ifndef _TYPES_H_ #define _TYPES_H_ typedef short dev_t; #ifndef _POSIX_SOURCE /* major part of a device */ #define major(x) ((int)(((unsigned)(x)>>8)&0377)) /* minor part of a device */ #define minor(x) ((int)((x)&0377)) /* make a device number */ #define makedev(x,y) ((dev_t)(((x)<<8) | (y))) #endif typedef unsigned char u_char; typedef unsigned short u_short; typedef unsigned int u_int; typedef unsigned long u_long; typedef unsigned short ushort; /* Sys V compatibility */ #include <machine/ansi.h> #if !defined(_ANSI_SOURCE) && !defined(_POSIX_SOURCE) #include <machine/types.h> #endif #ifdef _CLOCK_T_ typedef _CLOCK_T_ clock_t; #undef _CLOCK_T_ #endif #ifdef _SIZE_T_ typedef _SIZE_T_ size_t; #undef _SIZE_T_ #endif #ifdef _TIME_T_ typedef _TIME_T_ time_t; #undef _TIME_T_ #endif #ifndef _POSIX_SOURCE typedef struct _uquad { unsigned long val[2]; } u_quad; typedef struct _quad { long val[2]; } quad; #endif typedef long * qaddr_t; /* should be typedef quad * qaddr_t; */ typedef long daddr_t; typedef char * caddr_t; typedef u_long ino_t; typedef long swblk_t; typedef long segsz_t; typedef long off_t; typedef u_short uid_t; typedef u_short gid_t; typedef short pid_t; typedef u_short nlink_t; typedef u_short mode_t; typedef u_long fixpt_t; #ifndef _POSIX_SOURCE #define NBBY 8 /* number of bits in a byte */ /* * Select uses bit masks of file descriptors in longs. These macros * manipulate such bit fields (the filesystem macros use chars). * FD_SETSIZE may be defined by the user, but the default here should * be >= NOFILE (param.h). */ #ifndef FD_SETSIZE #define FD_SETSIZE 1024 #endif typedef long fd_mask; #define NFDBITS (sizeof(fd_mask) * NBBY) /* bits per mask */ #ifndef howmany #define howmany(x, y) (((x)+((y)-1))/(y)) #endif typedef struct fd_set { fd_mask fds_bits[howmany(FD_SETSIZE, NFDBITS)]; } fd_set; #define FD_SET(n, p) ((p)->fds_bits[(n)/NFDBITS] |= (1 << ((n) % NFDBITS))) #define FD_CLR(n, p) ((p)->fds_bits[(n)/NFDBITS] &= ~(1 << ((n) % NFDBITS))) #define FD_ISSET(n, p) ((p)->fds_bits[(n)/NFDBITS] & (1 << ((n) % NFDBITS))) #define FD_ZERO(p) bzero((char *)(p), sizeof(*(p))) #endif /* !_POSIX_SOURCE */ #endif /* !_TYPES_H_ */ SEE ALSO
fs(5), time(3), lseek(2), adb(1) HISTORY
A types file appeared in Version 7 AT&T UNIX. Darwin AUGUST 2, 2001 Darwin
All times are GMT -4. The time now is 12:18 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy