Sponsored Content
Top Forums Shell Programming and Scripting Grep command giving different result for different users for same command Post 302947489 by Pushpraj on Thursday 18th of June 2015 09:40:07 AM
Old 06-18-2015
Grep command giving different result for different users for same command

Hello,

I am running below command as root user
Code:
#nodetool cfstats tests | grep  "Memtable switch count"
Memtable switch count: 12

Where as when I try to run same command as another user it gives different result.
Code:
#su -l zabbix -s /bin/bash -c "nodetool cfstats tests | grep "Memtable switch count""
Memtable cell count: 0
Memtable data size: 0
Memtable off heap memory used: 0
Memtable switch count: 12

I am not sure why grep giving different result here.

Please help.

Thanks,
Pushpraj

Last edited by Pushpraj; 06-18-2015 at 11:44 AM.. Reason: Typo
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

assign subst|grep|sed command result to a variable

Hi, I'm quite new to scripting and I want to modify following line of an existing script: MYVAR=`subst |grep 'L:\\\:' | sed -e 's/.*\\\//'`; What I have to do is to use the content of a variable instead of the constant expression 'L:\\\:' as the grep string to be matched. Assuming I already... (5 Replies)
Discussion started by: snowbiker99
5 Replies

2. Linux

Terminal Execution By Giving a Command

Hi Guys, I am using Red Hat Linux 5 and GNOME Terminal is available there in the Accessories menu of Applications. But I don't see any run command option which can be used to type the name of the terminal and execute it directly as I used to do it under Mandrake Linux wherein I would type... (2 Replies)
Discussion started by: indiansoil
2 Replies

3. Shell Programming and Scripting

Last Command not giving year

Hi All, i want the last login details along with year. i tried below command but not giving me the year of last login. last <$Userid> | head -1 i heard that if it is current year then it wont display the year else it will display the year. is it so? if yes then , is there any way of... (1 Reply)
Discussion started by: ani_rvce
1 Replies

4. UNIX for Dummies Questions & Answers

Last Command not giving year

Hi All, i want the last login details along with year. i tried below command but not giving me the year of last login. last <$Userid> | head -1 i heard that if it is current year then it wont display the year else it will display the year. is it so? if yes then , is there any way of... (1 Reply)
Discussion started by: ani_rvce
1 Replies

5. Linux

acroread command giving error

Hi, When I run the command acroread it is giving error ERROR: Cannot find installation directory. When I look at /usr/local/Adobe/Acrobat7.0/bin/ an exicutable file named acroread is there. When i run ./acroread from that directory it is working . What can i do so that I can give... (3 Replies)
Discussion started by: iamjayanth
3 Replies

6. Shell Programming and Scripting

Use grep result to execute next command

Hi I am trying to run 2 servers using a script one after the other. I start the first one: run.sh -c servername >> jboss_log.txt & Then I have to wait until I see Started message in the log file before I launch the other server. I can't use sleep because I am not sure how long it'll... (5 Replies)
Discussion started by: iririr
5 Replies

7. Shell Programming and Scripting

If the grep command returns any result set

my intension is to use a grep command inside the shell script and if any row is returned or not.. depending on the resultset i have to code on further. how to check this i mean.. could anyone help me out with the if condition how to use it here !! (4 Replies)
Discussion started by: gotam
4 Replies

8. Shell Programming and Scripting

Grep result from dd command

Hi, I am running following command in a bash script for testing IO and use grep to get throughput number, but it did not work, it displayed everything: dd if=/dev/zero of=/dev/null bs=1G count=1 oflag=dsync | grep bytes | awk '{print $7}' 1+0 records in 1+0 records out 536870912 bytes... (2 Replies)
Discussion started by: hce
2 Replies

9. Shell Programming and Scripting

CUT command not giving correct result inside loop

Hi, i have a source file and have 3 columns and separated by "|" .i want to split this 3 columns in different variable.When i am executing this values indivisually giving correct result but when the same execute inside a for loop,it's giving issues. Src file(jjj.txt) -------... (8 Replies)
Discussion started by: raju2016
8 Replies

10. Shell Programming and Scripting

Linux find command seems to not transmit all the result to the '-exec command'

Hello. From a script, a command for a test is use : find /home/user_install -maxdepth 1 -type f -newer /tmp/000_skel_file_deb ! -newer /tmp/000_skel_file_end -name '.bashrc' -o -name '.profile' -o -name '.gtkrc-2.0' -o -name '.i18n' -o -name '.inputrc' Tha command... (3 Replies)
Discussion started by: jcdole
3 Replies
Mail::Mbox::MessageParser::Grep(3pm)			User Contributed Perl Documentation		      Mail::Mbox::MessageParser::Grep(3pm)

NAME
Mail::Mbox::MessageParser::Grep - A GNU grep-based mbox folder reader SYNOPSIS
#!/usr/bin/perl use Mail::Mbox::MessageParser; my $filename = 'mail/saved-mail'; my $filehandle = new FileHandle($filename); my $folder_reader = new Mail::Mbox::MessageParser( { 'file_name' => $filename, 'file_handle' => $filehandle, 'enable_grep' => 1, } ); die $folder_reader unless ref $folder_reader; # Any newlines or such before the start of the first email my $prologue = $folder_reader->prologue; print $prologue; # This is the main loop. It's executed once for each email while(!$folder_reader->end_of_file()); { my $email = $folder_reader->read_next_email(); print $email; } DESCRIPTION
This module implements a GNU grep-based mbox folder reader. It can only be used when GNU grep is installed on the system. Users must not instantiate this class directly--use Mail::Mbox::MessageParser instead. The base MessageParser module will automatically manage the use of grep and non-grep implementations. METHODS AND FUNCTIONS The following methods and functions are specific to the Mail::Mbox::MessageParser::Grep package. For additional inherited ones, see the Mail::Mbox::MessageParser documentation. $ref = new( { 'file_name' => <mailbox file name>, 'file_handle' => <mailbox file handle> }); <file_name> - The full filename of the mailbox <file_handle> - An opened file handle for the mailbox The constructor for the class takes two parameters. The file_name parameter is the filename of the mailbox. The file_handle argument is the opened file handle to the mailbox. Returns a reference to a Mail::Mbox::MessageParser object, or a string describing the error. BUGS
No known bugs. Contact david@coppit.org for bug reports and suggestions. AUTHOR
David Coppit <david@coppit.org>. LICENSE
This software is distributed under the terms of the GPL. See the file "LICENSE" for more information. HISTORY
This code was originally part of the grepmail distribution. See http://grepmail.sf.net/ for previous versions of grepmail which included early versions of this code. SEE ALSO
Mail::Mbox::MessageParser perl v5.10.1 2009-08-09 Mail::Mbox::MessageParser::Grep(3pm)
All times are GMT -4. The time now is 05:37 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy