Sponsored Content
Full Discussion: grep -- clarification
Operating Systems AIX grep -- clarification Post 302236224 by merajh on Monday 15th of September 2008 04:50:18 AM
Old 09-15-2008
Question grep -- clarification

Hi, I have a file which contains below info :

$ cat test_file
kenny
denny
kite

I want to get all th file names which starts with k. Hence i used below command but the result was not up to the mark :

$ grep 'k*' test_file
kenny
denny
kite

Can someone please explain me why this is behaving like this. Why it is giving 0 or more occurances when it should give 1 or more occurances ??

Waiting urgently ...
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Need clarification

Hi All, I am using Korn Shell HP UNIX and i am writing my scripts with filename extension as ksh or sh .. I want to know what is the difference if i am giving ksh and sh Other thing when we execute the shell script either we make it as executable and run directly else we give '.' or 'sh'... (2 Replies)
Discussion started by: ravi.sadani19
2 Replies

2. Shell Programming and Scripting

need clarification about tr -d command ?

Hi , I need your help to know the exact operation of this following code .. cat file1 | ux2dos | tr -d ''>>file2 file1 contains only one line : "DTS-PO\SPECTRUM WO 56" the data contains a META CHAR "\" .. look at the above line. But , The file2 output contains :... (7 Replies)
Discussion started by: vparunkumar
7 Replies

3. Web Development

Clarification

:confused: Hi All, i am new to unix....so i am not sure whether i am asking the related question with our forum.. My question .....Can anyone explain me about the CGI script is it something related to Unix or Linux or some other language. Thanks in advance Sha (1 Reply)
Discussion started by: Shahul
1 Replies

4. UNIX for Advanced & Expert Users

grep output clarification

dear all, can anyone clarify on this below regular expression output...because i feel this is not the output i should get according to the concepts... NOTE :Executed on linux system $ cat grepf abbbbd a.c abc ac abcd yyyy $ grep ^\a.c grepf a.c abc abcd $ grep a.c grepf... (4 Replies)
Discussion started by: rajp_8007
4 Replies

5. Shell Programming and Scripting

Need clarification on option in if

Hi, I am analisying an existing script. what the below code will do? if can some onle tell me what -a will do here. Upto my knowledge it can be used as and. In this case they gave a comment like-- it will check for the existance of the ref file. I feel -f need to be used to check the existence.... (2 Replies)
Discussion started by: kponsms
2 Replies

6. UNIX for Advanced & Expert Users

Need clarification

We are facing problem while executin below script, cat $PIPE_FILE | imscp - "${LRX_FILE_LOC}" 2>&1 | tee "${LIST_DIR}/${IMSCP_OUT_FILE}" & sqlplus -s ${REPORTING_CONNECT} <<EOF whenever sqlerror exit 1 rollback spool ${PIPE_FILE} start ${LRX_EXEC_SQL} ${LRX_MDL_RUN_DATE} spool off exit... (4 Replies)
Discussion started by: samiks14
4 Replies

7. Shell Programming and Scripting

permission clarification

crw-rw-rw- 1 root root 1, 5 May 6 1998 /dev/zero brw----rw- 1 root floppy 2, 28 May 6 1998 /dev/fd0H1440 In the above permission what is above C and B indicates? Thanks (1 Reply)
Discussion started by: thelakbe
1 Replies

8. UNIX for Advanced & Expert Users

Need Clarification

Hi All, I have a file cleanlogs_imgp01_files which has the contents as follows, cold_log|/opt/elf/cold_spool get_orion_log|/opt/elf/logs get_coldFiles_log|/opt/elf/logs get_coldFiles_TuesToSat_log|/opt/elf/logs get_coldFiles_MonToSat_log|/opt/elf/logs And when i execute this, I get the... (1 Reply)
Discussion started by: DevM
1 Replies

9. Shell Programming and Scripting

Nohup clarification

I have Main.sh script which will call 3 scripts as shown below. nohup script1.sh & nohup script2.sh & nohup script3.sh & Clarifification: Is all 3 scripts will be triggered at a time or it will trigger one by one(script1.sh---->script2.sh--->script3.sh)? (1 Reply)
Discussion started by: vamsi.valiveti
1 Replies

10. Shell Programming and Scripting

Variable clarification

what is the significance of %%.ksh in processname and %.ksh in processname_1 variable? Why is it returning same value?How is it working? processname=Testabc export processname=${processname%%.ksh} echo $processname #It is returning Testabc export processname_1=${processname%.ksh} echo... (2 Replies)
Discussion started by: vamsi.valiveti
2 Replies
XZGREP(1)							     XZ Utils								 XZGREP(1)

NAME
xzgrep - search compressed files for a regular expression SYNOPSIS
xzgrep [grep_options] [-e] pattern file... xzegrep ... xzfgrep ... lzgrep ... lzegrep ... lzfgrep ... DESCRIPTION
xzgrep invokes grep(1) on files which may be either uncompressed or compressed with xz(1), lzma(1), gzip(1), or bzip2(1). All options specified are passed directly to grep(1). If no file is specified, then the standard input is decompressed if necessary and fed to grep(1). When reading from standard input, gzip(1) and bzip2(1) compressed files are not supported. If xzgrep is invoked as xzegrep or xzfgrep then egrep(1) or fgrep(1) is used instead of grep(1). The same applies to names lzgrep, lze- grep, and lzfgrep, which are provided for backward compatibility with LZMA Utils. ENVIRONMENT
GREP If the GREP environment variable is set, xzgrep uses it instead of grep(1), egrep(1), or fgrep(1). SEE ALSO
grep(1), xz(1), gzip(1), bzip2(1), zgrep(1) Tukaani 2009-07-05 XZGREP(1)
All times are GMT -4. The time now is 03:46 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy