How can I get the results of a find back without the pathname
for example if i do
find ../../ -name \*.sql
i dont want to see
directory/directory/filename.sql
I only want to see filename.sql (3 Replies)
I have a question, and don't know my way around with it. :(
If I have a pathname
say. i have the following pathname:
/users/classA/tests
how can I get only 'tests' out of that path.
I know we have to use IFS=/ ... but next, i am clueless :confused:
I also know that I can use... (2 Replies)
With C Shell you can get the root, head, tail and extension of a pathname by using pathname variable modifiers.
Example Script:
#! /bin/csh
set pathvar=/home/WSJ091305.txt
echo $pathvar:r
echo $pathvar:h
echo $pathvar:t
echo $pathvar:e
The result of executing this script is:
... (7 Replies)
I am wondering if there's an easy way to extract individual directories from a pathname in a csh script. For example, if I have a shell variable such as
set datadirlist = /space/quimby/1
can I get 'space', 'quimby', and '1' and assign it individually to another variable?
Any suggestions... (2 Replies)
Hi,
Im finding some files form a specific path and den writing those files to another file as:
find /SYS/admin/data/xml -name '*.xml' -type f ! -newer file1 -print >>out.xml
and when im doing cat out.xml im getting like dis:
... (2 Replies)
Hi
Could someone help me?
I'm not sure how to find the full pathname of a directory.
I just want to be able to specify a directory.
e.g
directory1/directory2/directory3/directory4/directory5
I want to be able to put in "directory5"
and then i want a return of the full address.
... (3 Replies)
Hello.
After looking through the forum I am trying without success to remove lines from a file each time that ligne contains a pattern.
As this is running in script, I am using some variables:
The command : sed '/pattern/d' source_file > corrected_source_file
In the script
sed ... (2 Replies)
Hi!
If your working directory contains a file you want to work on, or give as an argument, you don't have to give the explicit pathname, just the filename, like so:
$ vi while_loop.ksh
But if you want execute an executable file, you must supply the explicate pathname, like so:
./while_loop.ksh... (20 Replies)
Hi,
I want to saperate file path and file name into two variables.
for ex:- lets say file is /home/prasoon/File.txt
i want FILE_PATH=/home/prasoon
and FILENAME=File.txt
i need your help.
Cheers
Prasoon (2 Replies)
I have a simple if statement I am working with to validate if a file exist and rename it using the following method:
if ;then mv .htaccess .htaccess.bak_$(date +%F-%T);fi;The output is just as it should be and I need to have that saved as a variable so that I can implement a revert changes... (3 Replies)
Discussion started by: moderhater
3 Replies
LEARN ABOUT MINIX
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)