03-16-2006
Another question!
How can the expression be if I have to do the same for multiple file extensions.. say i want to extract only those lines of .ksh, .sql and .ini. ??
Would this work?
grep "[\.ksh][\.ini][\.sql]$" stemp
Please correct me if I am wrong...
Appreciating ur help,
Sirisha
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
I want to grep "abc" from "logyy". I want not only the instance of "abc" to return, but the line just above it as well (no matter what it is).
:)
Can some one please assit me to drive on this (2 Replies)
Discussion started by: NIMISH AGARWAL
2 Replies
2. Shell Programming and Scripting
Hi,
I search for the string below which contains a single quote,
some text '/home/myuser
in the file myfile.txt as another user with the grep command as follows
su - myuser -c "grep 'some text \'/home/myuser' myfile.txt"
I also tried using two backslashes
su - myuser... (6 Replies)
Discussion started by: cimcmahon
6 Replies
3. Solaris
Hi I need urgently a Solaris 8 , 9 or 10 Booteable. I cant find a booteable cd in sun.com....any help would be appreciated!!! Thx in advance for your help.:) (4 Replies)
Discussion started by: lolos406
4 Replies
4. Shell Programming and Scripting
i want to get user input like this
please tell which option to chose
1. mango 2. tango 3. rango
if user chooses mango
then it should execute a set of statements and again ask like this
what do you want to do
1.add 2.subtract 3.exit
when i choose exit it should goto my previous... (1 Reply)
Discussion started by: s.deepak
1 Replies
5. Shell Programming and Scripting
Hi everyone, thank you so much for reading.
I built a user reference page from /etc/password for a class project. Now I need two shell scripts: 1) Add names to the reference page 2) Delete names from the reference page. I know grep -v is involved somehow and some piping but I am super stuck.
... (1 Reply)
Discussion started by: jsmpdx
1 Replies
6. Shell Programming and Scripting
I am trying to make a script that has grep finding lines that I get from the cat command, that start with something and end with an argument. I can get the first part, but whenever I try to add on the part that looks at the end of the line too, it stops working. Any ideas why? Here is my script:
... (11 Replies)
Discussion started by: sammythesp3rmy
11 Replies
7. UNIX for Dummies Questions & Answers
I have a text file (allWords.txt), that I would like to search through. Here is a snippet of what it looks like...
a
aah
aahed
aahing
aahs
aardvark
aardvarks
aardwolf
ab
abaci
aback
abacus
abacuses
abaft
......
I would like to use the grep search to search, line by line, for... (8 Replies)
Discussion started by: blackvelvet
8 Replies
8. OS X (Apple)
Hi,
I'm using Mac 10.9.1. I would like to create an alias for grep so that it won't print out messages like "grep: /Users/davea/workspace/myproject/subdir/: Is a directory" all the time. So in my terminal, I opened ~/.profile and entered
alias grep='grep -s'
However, when I close and... (5 Replies)
Discussion started by: laredotornado
5 Replies
9. UNIX for Beginners Questions & Answers
PH=(6H 0 0 JD 9S 0 KD 0) #input from .txt file
In the above array, I am trying to get the computer to tell me at what indices the non-zeros are at.
I don't understand why this doesn't work...
grep -v -b "0" ph.txt > position.txt
Isn't grep -v supposed to show non matches in Bash?... (2 Replies)
Discussion started by: cogiz
2 Replies
10. Shell Programming and Scripting
Good Morning,
i ran into some trouble this morning while 'improving' my monitoring stuff. i would like to get a warning when the number of mails sent (outbound) by postfix is above a certain number. so far, so easy. to test that i simply put
cat /var/log/mail.info | grep 'to=<' | grep -v -e... (1 Reply)
Discussion started by: Mike
1 Replies
inifile(n) Parsing of Windows INI files inifile(n)
__________________________________________________________________________________________________________________________________________________
NAME
inifile - Parsing of Windows INI files
SYNOPSIS
package require Tcl 8.2
package require inifile ?0.2.3?
::ini::open file ?access?
::ini::close ini
::ini::commit ini
::ini::revert ini
::ini::filename ini
::ini::sections ini
::ini::keys ini section
::ini::get ini section
::ini::exists ini section ?key?
::ini::value ini section key ?default?
::ini::set ini section key value
::ini::delete ini section ?key?
::ini::comment ini section ?key? ?text?
::ini::commentchar ?char?
_________________________________________________________________
DESCRIPTION
This package provides an interface for easy manipulation of Windows INI files.
::ini::open file ?access?
Opens an INI file and returns a handle that is used by other commands. access is the same as the first form (non POSIX) of the open
command, with the exception that mode a is not supported. The default mode is r+.
::ini::close ini
Close the specified handle. If any changes were made and not written by commit they are lost.
::ini::commit ini
Writes the file and all changes to disk. The sections are written in arbitrary order. The keys in a section are written in alphabet-
ical order. If the ini was opened in read only mode an error will be thrown.
::ini::revert ini
Rolls all changes made to the inifile object back to the last committed state.
::ini::filename ini
Returns the name of the file the ini object is associated with.
::ini::sections ini
Returns a list of all the names of the existing sections in the file handle specified.
::ini::keys ini section
Returns a list of all they key names in the section and file specified.
::ini::get ini section
Returns a list of key value pairs that exist in the section and file specified.
::ini::exists ini section ?key?
Returns a boolean value indicating the existance of the specified section as a whole or the specified key within that section.
::ini::value ini section key ?default?
Returns the value of the named key and section. If specified, the default value will be returned if the key does not exist. If the
key does not exist and no default is specified an error will be thrown.
::ini::set ini section key value
Sets the value of the key in the specified section. If the section does not exist then a new one is created.
::ini::delete ini section ?key?
Removes the key or the entire section and all its keys. A section is not automatically deleted when it has no remaining keys.
::ini::comment ini section ?key? ?text?
Reads and modifies comments for sections and keys. To write a section comment use an empty string for the key. To remove all com-
ments use an empty string for text. text may consist of a list of lines or one single line. Any embedded newlines in text are prop-
erly handled. Comments may be written to nonexistant sections or keys and will not return an error. Reading a comment from a nonex-
istant section or key will return an empty string.
::ini::commentchar ?char?
Reads and sets the comment character. Lines that begin with this character are treated as comments. When comments are written out
each line is preceded by this character. The default is ;.
BUGS, IDEAS, FEEDBACK
This document, and the package it describes, will undoubtedly contain bugs and other problems. Please report such in the category inifile
of the Tcllib SF Trackers [http://sourceforge.net/tracker/?group_id=12883]. Please also report any ideas for enhancements you may have for
either package and/or documentation.
CATEGORY
Text processing
inifile 0.2.3 inifile(n)