I have a text file containing data, seperated by TAB. I want to process this tab'ed data as variable. how can I assign this?
Ex:
I want to fetch, lets say, "54aaa" (5th row, 4th col) as a variable to be able to process it. then I will call it as $qweasd=nameofthisvaribale. I have tried with grep and cut but no result as I want.
thanks for your assist.
Last edited by radoulov; 08-25-2010 at 05:22 AM..
Reason: Added code tags!
hi,
i have a simple question:
in hpux 11i;
this cmd :
cat mailtest |grep sekar >test1
gives the output file with the name test1.
i want to remove the line which contains the "sekar" and put the result in the new file....
what is the command for that?.. (2 Replies)
i need to seperate values seperated by delimiters and assign it to an array.. can u plz help me on that.
Variables = "asd,rgbh,(,rty,got,),sroe,9034,"
i need to assign the variables into arrays..
like..
var=asd
var=rgbh.. and so on
how do i do this. i need to reuse the values stored in... (6 Replies)
Hello all,
I have some weird problem that kinda baffles me. Say I have the following test file:
claudia:~/tmp$ cat testfile.txt
This is a test line
This is the second test line
And yeah, this is the third test line
Then say I want to tail the file, grep for the word "third" then... (7 Replies)
Hi,
Is there any way I can grep an array against another array?
Basically here's what I need to do.
There will be an array containing some fixed texts and I have to check whether some files contain these lines. Reading the same files over and over again for each different pattern doesnt seem... (1 Reply)
not sure how to do it. wan't to delete it using cut and grep ince i would use it in the shell.
but how must the command be?
grep "64.233.181.103 wwwGoogle.com" /etc/hosts | cut -d
the delimeter is just a space. can you help meplease. :D (1 Reply)
file.txt : is delimiter:
abc:def:ghi
jkl:mno: pqr
123:456:789
if I do the cut command, and cut the first column, and echo it out
I will get the output:
abc
jkl
123
How can I assign the column of text that I've cut into Array?
e.g If I were to echo array array it will output as:... (9 Replies)
This is my command-line code in my script,
passwd=`grep $passwd $userfile | cut -f2 -d: login_users > retrieve`
the
cut -f2 -d: login_users > retrieve
searches and prints the whole column two. what I need is one of the items in the column two only.. what option can I add to my cut... (2 Replies)
Hi,
I have a SQL script with "create table" and "alter table" statements and I want to cut all the alter table statements from original file (A) and move it to a different file (B).
Can you please me the option. Thanks a lot for your time. (3 Replies)
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
LEARN ABOUT OPENDARWIN
zgrep
ZGREP(1) General Commands Manual ZGREP(1)NAME
zgrep - search possibly compressed files for a regular expression
SYNOPSIS
zgrep [ grep_options ] [ -e ] pattern filename...
DESCRIPTION
Zgrep is used to invoke the grep on compress'ed or gzip'ed files. All options specified are passed directly to grep. If no file is speci-
fied, then the standard input is decompressed if necessary and fed to grep. Otherwise the given files are uncompressed if necessary and
fed to grep.
If zgrep is invoked as zegrep or zfgrep then egrep or fgrep is used instead of grep. If the GREP environment variable is set, zgrep uses
it as the grep program to be invoked. For example:
for sh: GREP=fgrep zgrep string files
for csh: (setenv GREP fgrep; zgrep string files)
AUTHOR
Charles Levert (charles@comm.polymtl.ca)
SEE ALSO grep(1), egrep(1), fgrep(1), zdiff(1), zmore(1), znew(1), zforce(1), gzip(1), gzexe(1)ZGREP(1)