Sponsored Content
Top Forums Shell Programming and Scripting Issue executing grep command on Solaris Post 302974500 by drl on Tuesday 31st of May 2016 08:07:45 AM
Old 05-31-2016
Hi.

Some alternatives to GNU grep that allow -A, -B:
Code:
Print lines above, below pattern-matched line (context, window); "only" string matching pattern
        1) GNU grep -A -B; /usr/sfw/bin/ggrep on some Solaris

        2) peg, a perl script, does not use "-o" like GNU grep;
        allows -A, -B
        http://www.cpan.org/authors/id/A/AD/ADAVIES/peg-3.10 (or later)

        3) ack, a perl script, can use "-o" like GNU grep; allows -A, -B
           https://metacpan.org/pod/distribution/ack/ack

        4) cgrep does not use "-o" like GNU grep; allows -nline,
        +nline for context like GNU grep -A, -B; matching can cross lines
        http://sourceforge.net/projects/cgrep/

        5) bool, prints context in bytes; matching can cross lines

        6) greppm (xtcgrep), extension of CPAN grep; allow -C context; allows -o;
        complicated calling sequence; http://freecode.com/projects/greppm

        7) sift (aka "gogrep"), extremely fast grep work-alike, allows -A, -B, -C
           can "-o" using "--replace", matching can cross lines
       https://sift-tool.org/ (verified 2015.11.05)

        8) ag, "The Silver Searcher", similar to, but faster than ack.
           In Debian 8.4 repository, as "silversearcher-ag".

        9) pt, "The Platinum Searcher", similar to ag, faster than ack.
           https://github.com/monochromegane/the_platinum_searcher
           Uses "-w" as in "grep "-o"; written in "go". (verified 2016.04.25)

Stand-alone codes can be placed in one's own "bin" directory and used just like system commands (provided the PATH contains that directory).

Best wishes ... cheers, drl
 

10 More Discussions You Might Find Interesting

1. Solaris

Troubles building on solaris 9 and executing on solaris 10

Hi, I have to build an application on solaris 9 which is supposed to run on solaris 10 computers. I heard that solaris 9 builds should run on solaris 10 without any troubles. However, there is some trouble. Calling ldd on the programm reveals that "libgcc_s.so.1" and "libstdc++.so.6" are... (4 Replies)
Discussion started by: mikehammer80
4 Replies

2. Shell Programming and Scripting

issue with grep command

i am using 'psu' to grep the status of a process like below :- psu|grep -i agentf 29559 29552 0 00:53:05 ? 0:57 gn1avm_agent -n AGENTF1 28946 1 0 00:51:31 ? 0:31 gnavm_ewd -b gn1avm_agent -n AGENTF1 -c -n AGENTF1 29552 28946 0 00:53:05 ? 0:00 /bin/ksh... (6 Replies)
Discussion started by: deepakiniimt
6 Replies

3. HP-UX

Performance issue with 'grep' command for huge file size

I have 2 files; one file (say, details.txt) contains the details of employees and another file (say, emp.txt) has some selected employee names. I am extracting employee details from details.txt by using emp.txt and the corresponding code is: while read line do emp_name=`echo $line` grep -e... (7 Replies)
Discussion started by: arb_1984
7 Replies

4. UNIX for Dummies Questions & Answers

Grep command issue

How am I supposed to print with one Unix command the names (and only the names) of company JMT? Problems with scandinavian letters? By typing grep JMT url | egrep --only-matching ']+'I still have company name and + marks I should get rid of. I'd be very grateful of your help bacause I am new... (1 Reply)
Discussion started by: jht
1 Replies

5. Shell Programming and Scripting

CUT Command and grep issue

I am trying to grep the oracle erros evry day from the logs file. My problem is : -rw-r----- 1 tibcolm tibco 17438361 Apr 5 11:59 RetryService-RetryService.log -rw-r----- 1 tibcolm tibco 245303 Apr 5 12:00 ResponseService-ResponseService.log -rw-r----- 1 tibcolm tibco 2122654 Apr 5 12:00... (4 Replies)
Discussion started by: neeraj617
4 Replies

6. Shell Programming and Scripting

Issue while executing script

Hi, I'm trying to use the below command in a shell script, but couldn't. The command is working fine when I'm executing from the dollar prompt i.e. shell. Command: grep -i fail /home/applmgr/error.log |egrep -i "`date --date="-4 day" +"%m/%d/%Y"`|`date --date="-4 day" +"%m/%d/%y"`"... (8 Replies)
Discussion started by: venkatesh17
8 Replies

7. UNIX for Dummies Questions & Answers

grep issue (Solaris)

Can anyone explain this (i.e. why the 2nd grep does not find anything)?: -bash-3.00$ cat tmp.log sftp> chdir /home/test-dir sftp> mget thosefiles*.txt File "/home/test-dir/thosefiles*.txt" not found. -bash-3.00$ grep "s*.txt" tmp.log sftp> mget thosefiles*.txt File... (4 Replies)
Discussion started by: dhebden
4 Replies

8. Shell Programming and Scripting

Issue when executing shc command

Hi All, I am trying to create an executable using shc. I have a script which is creating 10 executables. The executables being created have the below issue. The message "Please contact your provider" is displayed even though I am not using the “-e” option. This message is coming for some... (5 Replies)
Discussion started by: temp_user
5 Replies

9. Shell Programming and Scripting

Issue using empty variable in grep command

Hi, I'm writing a shell script and trying to grep a variable value, it works fine as long as there is a value in /tmp/list.out which is captured in $DSK but sometimes the file tends to be empty and that is where I'm having an issue while using grep which returns nothing. I know I can use something... (15 Replies)
Discussion started by: mbak
15 Replies

10. Shell Programming and Scripting

Issue with awk command between Linux and Solaris

Hi, Here is the output using bash profile on Linux uptime 04:59:14 up 16 days, 4:48, 2 users, load average: 1.00, 1.00, 1.20 Here is the output using bash profile on Solaris uptime 4:00am up 84 day(s), 22:21, 3 users, load average: 0.09, 0.10, 0.12 Now,... (4 Replies)
Discussion started by: mohtashims
4 Replies
asadmin-create-jdbc-resource(1AS)				   User Commands				 asadmin-create-jdbc-resource(1AS)

NAME
asadmin-create-jdbc-resource, create-jdbc-resource - registers the JDBC resource SYNOPSIS
create-jdbc-resource --user admin_user [--password admin_password] [--host localhost] [--port 4848] [--secure|-s] [--passwordfile filename] [--terse=false] [--echo=false] [--interactive=true] --connectionpoolid ID [--enabled=true] [--description text] jndi_name Registers the JDBC resource. This command is supported in remote mode only. OPTIONS
--user authorized domain application server administrative username. --password password to administer the domain application server. --host machine name where the domain application server is running. --port port number of the domain application server listening for administration requests. --secure if true, uses SSL/TLS to communicate with the domain application server. --passwordfile file containing the domain application server password. --terse indicates that any output data must be very concise, typically avoiding human-friendly sentences and favoring well- formatted data for consumption by a script. --echo setting to true will echo the command line statement on the standard output. --interactive prompts you for the required options that are not already specified. --connectionpoolid name of the JDBC connection pool. If two or more JDBC resource elements point to the same connection pool element, they will use the same pool connections at runtime. --enabled determines whether the resource is enabled at runtime. --description text description of the JDBC resource. OPERANDS
jndi_name JNDI name for resource to be created. Example 1: Using the create-jdbc-resource command asadmin> create-jdbc-resource --user admin1 --password adminadmin1 --host pigeon --port 5001 --connectionpoolid XA_connection_pool --description "creating a sample jdbc resource" sample_jdbc_resource Command create-jdbc-resource executed successfully Where: sample_jdbc_resource is the resource that is created. EXIT STATUS
0 command executed successfully 1 error in executing the command asadmin-delete-jdbc-resource(1AS), asadmin-list-jdbc-resources(1AS) J2EE 1.4 SDK March 2004 asadmin-create-jdbc-resource(1AS)
All times are GMT -4. The time now is 05:57 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy