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
10 More Discussions You Might Find Interesting
1. UNIX for Advanced & Expert Users
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
2. Shell Programming and Scripting
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
3. Shell Programming and Scripting
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
4. Shell Programming and Scripting
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
5. Shell Programming and Scripting
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
6. Shell Programming and Scripting
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
7. Shell Programming and Scripting
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
8. Shell Programming and Scripting
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
9. Shell Programming and Scripting
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
10. Programming
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
LEARN ABOUT DEBIAN
grap2graph
GRAP2GRAPH(1) General Commands Manual GRAP2GRAPH(1)
NAME
grap2graph - convert a grap diagram into a cropped bitmap image
SYNOPSIS
grap2graph [ -unsafe ] [ -resolution M|MxN ] [ -format fmt ]
DESCRIPTION
Reads a grap program as input; produces an image file (by default in Portable Network Graphics format) suitable for the Web as output. For
a description of the grap language, see grap(1).
Your graph specification should not be wrapped with the .G1 and .G2 macros that normally guard it within groff(1) macros.
The output image will be a black-on-white graphic clipped to the smallest possible bounding box that contains all the black pixels. By
specifying command-line options to be passed to convert(1) you can give it a border, set the background transparent, set the image's pixel
density, or perform other useful transformations.
This program uses grap(1), pic(1), groff(1), and the ImageMagick convert(1) program. These programs must be installed on your system and
accessible on your $PATH for grap2graph to work.
OPTIONS
-unsafe
Run pic(1) and groff(1) in the `unsafe' mode enabling the PIC macro sh to execute arbitrary commands. The default is to forbid
this.
-format fmt
Specify an output format; the default is PNG (Portable Network Graphics). Any format that convert(1) can emit is supported.
Command-line switches and arguments not listed above are passed to convert(1).
ENVIRONMENT
GROFF_TMPDIR
The directory in which temporary files will be created. If this is not set grap2graph searches the environment variables TMPDIR,
TMP, and TEMP (in that order). Otherwise, temporary files will be created in /tmp.
SEE ALSO
pic2graph(1), eqn2graph(1), pic(1), groff(1), gs(1), convert(1).
AUTHOR
Eric S. Raymond <esr@thyrsus.com>
Groff Version 1.21 31 December 2010 GRAP2GRAPH(1)