how to format a grep command


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting how to format a grep command
# 1  
Old 11-17-2005
how to format a grep command

Hello

I am trying to use the grap command to locate the following phrase in a file:
"file.php\tDebug: one two three"

Note that \t denotes a tab (whitespace) and not the characters \ and t

I am encountering the following 2 problems:
1) there is a perido between "file" and "php" which needs to be encoded somehow
2) there is a tab between "php" and "Debug" which needs to be encoded somehow

I would appreciate it if someone could some me what the correct syntax for this command should be

In a more general note, I would appreciate if someone could refer me to a manual on using grep, including character escaping

regards and thanks in advance
# 2  
Old 11-17-2005
Put the whole thing in double quotes and put a backslash in front of the dot. For the tab, just hit the tab key.
# 3  
Old 11-18-2005
Thanks Perderabo
I will follow your advise
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Programming

Python or Shell script to Grep strings from input file and output in csv format

Hi Experts, I am writing a python script to grep string from file and display output in csv file as in attached screenshot https://drive.google.com/file/d/1gfUUdfmQma33tz65NskThYDhkZUGQO0H/view Input file(result_EPFT_config_device) Below is the python script i have prepared as of... (1 Reply)
Discussion started by: as7951
1 Replies

2. Shell Programming and Scripting

Need to grep this Data in proper format:- Please Guide

Hi Guys, I need to grep below data in this format backup_id creation expiration policy sched_label backup_id = picoserver38_1212077050, version = 2 creation = 05/29/2008 18:04:10 (1212077050) expiration = 06/29/2008 18:04:10 (1214755450) retention_level = 3, fragment = 2, file_num = 1... (14 Replies)
Discussion started by: manalisharmabe
14 Replies

3. Shell Programming and Scripting

Grep command output in tabular format

I have a grep command script which works fine and give the correct results but i wanted the output to be displayed in tabular format ? Is it possible to display the output in tabular format and as well direct them to some file. main script : #!/usr/bin/bash Start_Time=`date '+%m%d%y... (1 Reply)
Discussion started by: Optimus81
1 Replies

4. Shell Programming and Scripting

Grep commands & format

I have these grep commands and need to put them next each other (in horizontal layout). cat /tmp/dsmc.out |grep Done cat /tmp/dsmc.out |grep "Elapsed processing time:" cat /tmp/dsmc.out |grep "Client date/time:" cat /tmp/dsmc.out |grep "Total number of bytes transferred:" so that it... (6 Replies)
Discussion started by: Daniel Gate
6 Replies

5. Shell Programming and Scripting

Perl code to grep a particular column in CSV format

Hi I want to grep a column 6 & column 7 from a CSV Format file & then i have to find the difference between these columns as these both columns contains date & time in 7/7/2012 9:20 this format . So kindly help me out ASAP. But please kindly dis xls has to be converted in csv format as may... (5 Replies)
Discussion started by: Prateek@123
5 Replies

6. Shell Programming and Scripting

can anyone help with shell script command about searching word with grep command?

i want to search in the current directory all the files that contain one word for example "hello" i want to achieve it with the grep command but not with the grep * (2 Replies)
Discussion started by: aintour
2 Replies

7. Shell Programming and Scripting

Grep, then format then prepare a string

Hi I have a file which is having line like below Personal Unit=AU003 (Industrial Products Division),Plant=B00089,Departmant=D110 When ever i fine line starting sith Personal Unit and contains Plant Department I need to pick this line and format it like Personal Unit=AU003 ... (7 Replies)
Discussion started by: krishna.fuji
7 Replies

8. Shell Programming and Scripting

grep using date format

i have few persistance apps like below pipe 1118370 1200312 0 Dec 18 - 192:03 java - _AppName=DBSyncController pipe 2523376 1568906 0 feb 25 - 386:15 java -Xms128m -Xmx1024m -D_AppName=DBMaint com pipe 7462996 2531452 0 march 18 - 23:22 java... (4 Replies)
Discussion started by: ali560045
4 Replies

9. Shell Programming and Scripting

grep using date format

i have a process ruuning root 843786 835648 0 Nov 10 - 0:31 java root 860340 1 0 Nov 11 - 0:31 then how to grep this using date above i have written a script ---------------------------- #!/bin/ksh a=`date +"%m-%d"` ps | grep root | grep "$a" >> file1... (8 Replies)
Discussion started by: ali560045
8 Replies

10. UNIX for Advanced & Expert Users

how to exclude the GREP command from GREP

I am doing "ps -f" to see my process. but I get lines that one of it represents the ps command itself. I want to grep it out using -v flag, but than I get another process that belongs to the GREP itself : I would like to exclude # ps -f UID PID PPID C STIME TTY TIME CMD... (2 Replies)
Discussion started by: yamsin789
2 Replies
Login or Register to Ask a Question