Problems with using grep to make backups to a different directory
I am trying to program a script that is using grep to find lines in a file in my home directory, and then use a pipe command to copy what is shown into different files in a different directory to create backup files. When I run it, though, it only creates a copy of the file that grep was going through, not the actual lines it found in that file. Here is a sample of the code:
The first argument is the file you want to use grep on, and the second argument is the directory I want the backup to be put to, with the same filename with a .bak at the end. Any ideas on what I'm doing wrong and why it isn't copying the whole thing? Thank you
I'm trying to compile and install both most recent version of 'make' and the
most recent version of 'openssh' on my Sparc20.
I've run into the following problems... and I don't know what they mean. Can
someone please help me resolve these issues?
I'm using the 'make' version that was... (5 Replies)
I have installed gcc 295.3 and make 3.79.1 and I am attempting to compile the apache installation. I can run ./configure and no errors occur. However, when I try to run make it complains that it is unable to find the ar command. Here is the output after entering make. Any help is appreciated.
#... (2 Replies)
I am running a make file through the gnu make tool and i am getting the following error
jsh1035c:/users/egate453/admegate/kapil/samples $ make -f GNUmakefile queue_c
make -f ./GNUmakefile queue_c in_objdir=1 build_root=/users/egate453/admegate/kapil/samples
make: Entering directory... (2 Replies)
I seem to be having some problems using make - I am getting the following error code:
make: Fatal error: Command failed for target `machine.o'
So far I have tried to install top from the tar file.
I gunzip the file - and then used tar xvf. This all works fine but i then use the make command... (1 Reply)
Hey Guys,
Wondering if there is a way to do the following
I have a file called test.txt
abc
def
abc
abc
def
I have a pattern file called pattern.txt containing the following
abc
def
I want to do a count, but have it display the count value preceeding each line like grep -n (2 Replies)
Can anyone help with an HP Ignite problem please !!
We currently have 2 servers running HP-UX B.11.00 connected together and using a high availability cluster (serviceguard) running one package.
Each of the servers have 2 mirrored local disks. (also installed HP OpenviewDM B.05.03, Oracle 8.0.5,... (7 Replies)
I am tring to install DBD::Oracle on Solaris 9 box, I issued command
type cc
type gcc
but both are not found.
then i manually searched for gcc, i found it and create a symbolic link to it in my directory.
$ perl Makefile.pl
(works ok)
$ make
(retuns error below)
LD_RUN_PATH="" cc -G... (1 Reply)
Hi all,
I'm working on a server with Solaris 10 and I'm trying to install the pptp client version 1.7.2.
So, the generation of the execute file is ok, I run the command 'make' and I got the pptp file.
Now I have to run the command 'make install' to install the software, but it stops at the... (3 Replies)
Hi Guys
This is my first post so I am not sure how things go here. I'm sorry if I'm breaking the rule or something. Feel free to correct me about that :)
So as I was saying...
I'd been trying to grep this folder containing 900,000 txt files but seems no luck. I get either "No such file... (6 Replies)
Discussion started by: Nexeu
6 Replies
LEARN ABOUT V7
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 invokes grep on compressed or gzipped files. These grep options will cause zgrep to terminate with an error code:
(-[drRzZ]|--di*|--exc*|--inc*|--rec*|--nu*). All other options specified are passed directly to grep. If no file is specified, 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 the GREP environment variable is set, zgrep uses it as the grep program to be invoked.
EXIT CODE
2 - An option that is not supported was specified.
AUTHOR
Charles Levert (charles@comm.polymtl.ca)
SEE ALSO grep(1), gzexe(1), gzip(1), zdiff(1), zforce(1), zmore(1), znew(1)ZGREP(1)