LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 04-07-2010, 02:21 AM   #1
nkataria
LQ Newbie
 
Registered: Jun 2008
Posts: 20

Rep: Reputation: 0
Unhappy ps | grep command combination - Strange Output. Why Environment Variables Listed ?


Can Any body explain the following command output ?

###############################################
[root@abcd-pc root]# ps -ef | grep anacron
root 20282 3641 0 12:07 pts/3 00:00:00 grep anacron HOSTNAME=abcd-pc SHELL=/bin/bash TERM=xterm HISTSIZE=1000 QTDIR=/usr/lib/qt-3.3 OLDPWD=/etc/cron.daily USER=root LD_LIBRARY_PATH=:/usr/local/Trolltech/Qt-4.3.0/lib LS_COLORS=no=00:fi=00:di=00;34:ln=00;36i=40;33:so=00;35:bd=40;33;01:cd=40;33;01r=01;05;37;41:mi= 01;05;37;41:ex=00;32:*.cmd=00;32:*.exe=00;32:*.com=00;32:*.btm=00;32:*.bat=00;32:*.sh=00;32:*.csh=00 ;32:*.tar=00;31:*.tgz=00;31:*.arj=00;31:*.taz=00;31:*.lzh=00;31:*.zip=00;31:*.z=00;31:*.Z=00;31:*.gz =00;31:*.bz2=00;31:*.bz=00;31:*.tz=00;31:*.rpm=00;31:*.cpio=00;31:*.jpg=00;35:*.gif=00;35:*.bmp=00;3 5:*.xbm=00;35:*.xpm=00;35:*.png=00;35:*.tif=00;35: KDEDIR=/usr USERNAME=root MAIL=/var/spool/mail/root PATH=/usr/kerberos/sbin:/usr/kerberos/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/X11R6/bin:/root/bin:/usr/local/Trolltech/Qt-4.3.0/bin:. INPUTRC=/etc/inputrc PWD=/root LANG=en_US.UTF-8 SSH_ASKPASS=/usr/libexec/openssh/gnome-ssh-askpass SHLVL=1 HOME=/root BASH_ENV=/root/.bashrc LOGNAME=root LESSOPEN=|/usr/bin/lesspipe.sh %s DISPLAY=:0.0 G_BROKEN_FILENAMES=1 XAUTHORITY=/root/.xauthUhz1Eu _=/bin/grep /bin/grep
#################################################

Actually I was checking whether anacron is running presently on my system. Seen this strange output. Again executed the same command, but only the first line upto "anacron" appears.

I can understand that the output upto "grep anacron" is coming in the first line, but why all the environment variables were displayed during first execution?
 
Old 04-07-2010, 03:50 AM   #2
devnull10
Member
 
Registered: Jan 2010
Location: Lancashire
Distribution: Slackware Stable
Posts: 572

Rep: Reputation: 120Reputation: 120
Perhaps you have buggered something up in your .bashrc file with aliases etc (ie, not terminating with a '), which is causing the additional output??
 
  


Reply

Tags
environment, grep, ps, variables



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Environment Variables and the At Command Woodsman Linux - General 8 04-06-2009 02:15 PM
Grep on output of command returns all output traigo Linux - Newbie 2 02-24-2009 05:15 PM
grep and assign it's output to variables inside script itself problem xxx_anuj_xxx Programming 3 09-22-2007 11:24 PM
Need Grep command for the following output minil Programming 2 12-29-2005 07:49 AM
G++ environment variables, rerouting output, file listings and PIDs Kawahee Programming 7 09-19-2005 12:40 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 03:50 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration