Sponsored Content
Full Discussion: Newbie Question
Top Forums UNIX for Dummies Questions & Answers Newbie Question Post 52241 by anarchie on Monday 14th of June 2004 03:23:15 PM
Old 06-14-2004
grep -v "unwanted word" "filename.txt"

The -v option causes grep to find all lines not containing the following pattern.
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

newbie question

hi im thinking of getting unix but i have no idea where to start I know that its an OS similar to linux but what hardware does in run on? i've heard of solaris but im not quit sure what it is thankxs (3 Replies)
Discussion started by: ninja
3 Replies

2. UNIX Desktop Questions & Answers

Newbie Question

I am fairly new to *nix/linux and I have just installed SuSe 8.2. I am wondering what skills would be good to learn. I know that I will need to learn how to write scripts, but what scripting languages should I learn. I greatly appreciate any and all comments. ... (5 Replies)
Discussion started by: Ntalektual
5 Replies

3. Shell Programming and Scripting

Newbie question

Hello, I have text file while looks this test1 test2 test3 test4 test5 test6 and if I want to parse it and make new file which would like this test1 test2 test3 test4 test5 test6 How can I do this in korn shell script Thanks (9 Replies)
Discussion started by: peeyush_23
9 Replies

4. UNIX for Dummies Questions & Answers

Very new newbie question

sorry if im not asking inthe right spot but, how do you turn the beeping off every time you hit a key onthe keyboard. I tried the click -n but it told me it didnt recognize click any help would be greatly appreciated ( the beeping is not going over well in the surrounding cubicles) thank you... (4 Replies)
Discussion started by: Split100
4 Replies

5. UNIX for Dummies Questions & Answers

newbie question

I am taking a db classes toward oracle 10g. I am taking unix as well . I need to know what is the best option for os . should I use linux fedora. or get a sun box and start learning from there. Thanks (6 Replies)
Discussion started by: xzyan
6 Replies

6. UNIX for Dummies Questions & Answers

Newbie question?

What is the best way to learn UNIX on the web, with out buying books? any link would be much help. Thank you in advance, L (1 Reply)
Discussion started by: lsoria1
1 Replies

7. Programming

Newbie question

Dear all, I have a question related to parallel programing and if you can give me some hints on how to deal with it, it would be really great. I would like to run a small application on a supercompter of 128 CPUs. Unfortunately, on this machine only jobs which require 32 CPUs are allowed to... (1 Reply)
Discussion started by: Eduard
1 Replies

8. UNIX for Dummies Questions & Answers

UNIX newbie NEWBIE question!

Hello everyone, Just started UNIX today! In our school we use solaris. I just want to know how do I setup Solaris 10 not the GUI one, the one where you have to type the commands like ECHO, ls, pwd, etc... I have windows xp and I also have vmware. I hope I am not missing anything! :p (4 Replies)
Discussion started by: Hanamachi
4 Replies

9. Shell Programming and Scripting

perl newbie . &&..programming newbie (question 2)

Hello everyone, I am having to do a lot of perl scripting these days and I am learning a lot. I have this problem I want to move files from a folder and all its sub folders to one parent folder, they are all .gz files.. there is folder1\folder2\*.gz and there are about 50 folders... (1 Reply)
Discussion started by: xytiz
1 Replies

10. UNIX for Dummies Questions & Answers

newbie question

Hi all, I am sure this is very simple but I cant quite get it. I am trying to search textfile1.txt for a string then take the results of the search and append the result to textfile3.txt So far I have used $ find file1.txt -exec grep "string i am looking for" '{}' \; -print this... (2 Replies)
Discussion started by: radgator
2 Replies
unifdef(1)						      General Commands Manual							unifdef(1)

NAME
unifdef - Removes #ifdefed lines SYNOPSIS
unifdef [-tlc] [-Dsymbol] [-idsymbol] [-iusymbol] [file] [-Usymbol] The unifdef command partially simulates the behavior of the C preprocessor in processing #ifdef conditionals. OPTIONS
Complements the action of unifdef; retains lines that would normally be removed and removes lines that would normally be retained. Speci- fies symbol as a defined #ifdef symbol. Specifies defined lines inside certain #ifdefs to be ignored but copied out. Specifies undefined lines inside certain #ifdefs to be ignored and not copied out. Replaces removed lines with blank lines instead of deleting them. Pro- cesses plain text (rather than C code) input. The unifdef command does not try to recognize comments, single quotes, and double quotes. Specifies symbol as an undefined #ifdef symbol. DESCRIPTION
The unifdef command recognizes nested #ifdefs, comments, single and double quotes of C syntax so that it can function correctly, but does not include files or interpret macros. The unifdef command recognizes, but does not remove comments. The unifdef command takes its input from stdin if no file argument is given, and copies its output to stdout. You specify the symbols you want defined with -Dsymbol or undefined with -Usymbol and the lines inside those #ifdefs are copied to the out- put or removed, as appropriate. The #ifdef, #ifndef, #else, #elif, and endif lines associated with symbol are also removed. The #ifdefs involving unspecified symbols are untouched and copied out along with their associated #ifdef, #else, elif, and #endif lines. If the same symbol appears in more than one argument, only the first occurrence is significant. For instance, if an #ifdef X occurs nested inside another #ifdef X, the inside #ifdef is considered an unrecognized symbol. If you use #ifdefs to delimit non-C lines, such as comments or unfinished code, it is necessary to specify which symbols are to be used for that purpose. Otherwise, the unifdef command tries to parse for quotes and comments in those #ifdef lines. Keywords The following keywords can be used with the unifdef command: ifdef ifndef else endif elif The unifdef command uses the elif keyword as follows. (Note that "Understood" means unifdef knows how to convert elif to if.) Understood Not understood Not understood For example: # ifdef X x # elif defined (Y) y # elif defined (A) || defined (B) a # else default # endif The following list shows the results of using the elif keyword with variables: -DX x -UX # if defined (Y) y # elif defined (A) || defined (B) a # else default # endif -UX -DY y -UY -UX # if defined (Y) y # elif defined (A) || defined (B) a # else default # endif -UY -UX -DA # if defined (Y) y # elif defined (A) || defined (B) a # else default # endif NOTES
The unifdef command cannot process cpp constructs such as: #if defined(X) || defined(Y) DIAGNOSTICS
The unifdef command can fail for several reasons: a premature end of file, or an inappropriate else, elif, or endif. EXIT STATUS
Exit status is 0 if output is an exact copy of input, 1 if not, 2 if the unifdef command fails. EXAMPLES
The following command line causes the unifdef command to read the file original.c and remove the #ifdef A lines. It then removes every- thing following an #elif/#else associated with the #ifdef A down to the #endif: unifdef -DA original.c > modified.c The following command line causes the unifdef command to read the file original.c, and remove the #ifdef A down to either its associated #elif/#else, or its associated #endif: unifdef -UA original.c > modified.c In the case of the #elif, the #elif is replaced with #if. In the case of #else, the #else is deleted along with its associated #endif. SEE ALSO
Commands: diff(1) unifdef(1)
All times are GMT -4. The time now is 04:59 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy