Sponsored Content
Top Forums Shell Programming and Scripting BASH: How do I grep on a variable? (or simmilar question that makes sense) Post 302309852 by Quan on Thursday 23rd of April 2009 04:36:42 AM
Old 04-23-2009
Quote:
Originally Posted by cfajohnson
Code:
printf "%s\n" "$bookfile" | grep -i horror


Thank you loads!!
 

9 More Discussions You Might Find Interesting

1. Linux Benchmarks

Linux Benchmarks Makes No Sense

I created two computers with identical hardware, and run the benchmark programs in both starting at the same exact time. What makes no sense is that the computer that has the lower average index (121) finished the race a good 30 minutes ahead of the computer wich showed the higher avg index... (0 Replies)
Discussion started by: philip_38
0 Replies

2. UNIX for Dummies Questions & Answers

Simple grep - Not sure it makes sense!

I have 3 files in directory mydir named as follows, I run the sequence of commands shown below and I have questions at the result. File names are: ABC_GP0 ABC_GP0.ctl ABC_GPX Commands and results: $ ls /mydir/ | grep * <-- (q1) I get nothing - OK $ ls /mydir/ | grep... (5 Replies)
Discussion started by: GNMIKE
5 Replies

3. Shell Programming and Scripting

diff result makes no sense

Hi, I have written a small shellscript Imagine dbalt.txt already existed... " .... touch report.txt lynx -dump "http://site.com/index.htm" > site1.txt lynx -dump "http://site.com/index2.htm" > site2.txt grep -E 'Nummer: |EUR' site1.txt > preis1.txt grep -E 'Nummer: |EUR' site2.txt >... (2 Replies)
Discussion started by: Blackbox
2 Replies

4. Shell Programming and Scripting

Bash scripting, question about a variable

Hey, So I've run into a problem, due to my limited knowledge of Bash scripting. Basically I've got a long script and I want to understand it before I even try and edit it. As long as I don't understand the script, I will not bother editing it. Anyway, the following variable confuses me... (5 Replies)
Discussion started by: abciscool
5 Replies

5. Shell Programming and Scripting

(BASH) Using a loop variable to grep something in a file?

Hi, I have a loop running until a variable L that is read previously in the full script. I'd like to grep some information in an input file at a line that contains the value of the loop parameter $i. I've tried to use grep, but the problem is nothing is written in the FILE files. It seems grep... (5 Replies)
Discussion started by: DMini
5 Replies

6. Shell Programming and Scripting

bash: using a string variable in grep

Hi, I've been stuck for several days on this. Using grep on a command line, I can use quotes, eg... grep 'pattern of several words' filename I want to do this in my bash script. In my script I have captured the several command line arguments (eg arg1 arg2) into a variable: variable=$@ I... (2 Replies)
Discussion started by: adrian777uk
2 Replies

7. Programming

This Makes NO sense. I'm making a game and getting an error, need help.

Okay so I'm making a simple text based game that branches into different scenarios. By branching I mean branching off into whole different files with that part of the game in it. I got tired of working on scenario 1 so I'm working on scenario 2. As I get started and try to test it, I get an error... (1 Reply)
Discussion started by: lemonoid
1 Replies

8. Shell Programming and Scripting

Shell Text Based Game, This Error Makes NO sense. Please help

Okay so I'm making a simple text based game that branches into different scenarios. By branching I mean branching off into whole different files with that part of the game in it. I got tired of working on scenario 1 so I'm working on scenario 2. As I get started and try to test it, I get an... (3 Replies)
Discussion started by: lemonoid
3 Replies

9. Shell Programming and Scripting

Bash variable assignment question

Suppose I have a file named Stuff in the same directory as my script. Does the following assign the file Stuff to a variable? Var="Stuff" Why doesn't this just assign the string Stuff? Or rather how would I assign the string Stuff to a variable in this situation? Also, what exactly is... (3 Replies)
Discussion started by: Riker1204
3 Replies
page_util_quote(n)					      Parser generator tools						page_util_quote(n)

__________________________________________________________________________________________________________________________________________________

NAME
page_util_quote - page character quoting utilities SYNOPSIS
package require page::util::quote ?0.1? package require snit ::page::util::quote::unquote char ::page::util::quote::quote'tcl char ::page::util::quote::quote'tclstr char ::page::util::quote::quote'tclcom char _________________________________________________________________ DESCRIPTION
This package provides a few utility commands to convert characters into various forms. API
::page::util::quote::unquote char A character, as stored in an abstract syntax tree by a PEG processor (See the packages grammar::peg::interpreter, grammar::me, and their relations), i.e. in some quoted form, is converted into the equivalent Tcl character. The character is returned as the result of the command. ::page::util::quote::quote'tcl char This command takes a Tcl character (internal representation) and converts it into a string which is accepted by the Tcl parser, will regenerate the character in question and is 7bit ASCII. The string is returned as the result of this command. ::page::util::quote::quote'tclstr char This command takes a Tcl character (internal representation) and converts it into a string which is accepted by the Tcl parser and will generate a human readable representation of the character in question. The string is returned as the result of this command. The string does not use any unprintable characters. It may use backslash-quoting. High UTF characters are quoted to avoid problems with the still prevalent ascii terminals. It is assumed that the string will be used in a double-quoted environment. ::page::util::quote::quote'tclcom char This command takes a Tcl character (internal representation) and converts it into a string which is accepted by the Tcl parser when used within a Tcl comment. The string is returned as the result of this command. BUGS, IDEAS, FEEDBACK This document, will undoubtedly contain bugs and other problems. Please report such in the category page of the Tcllib SF Trackers [http://sourceforge.net/tracker/?group_id=12883]. Please also report any ideas for enhancements you may have. KEYWORDS
page, parser generator, quoting, text processing CATEGORY
Page Parser Generator COPYRIGHT
Copyright (c) 2007 Andreas Kupries <andreas_kupries@users.sourceforge.net> page 1.0 page_util_quote(n)
All times are GMT -4. The time now is 10:39 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy