The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
Google UNIX.COM


UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Development Releases: Linux Mint 4.0 Beta "Fluxbox", 4.0 Alpha "Debian" iBot UNIX and Linux RSS News 0 01-04-2008 12:00 PM
grep to find content in between curly braces, "{" and "}," keshav_rk Shell Programming and Scripting 4 08-09-2007 07:14 PM
how could i make a program mixed with many "|", "<" and ">" strugglingman High Level Programming 2 04-29-2006 05:11 AM
No utpmx entry: you must exec "login" from lowest level "shell" peterpan UNIX for Dummies Questions & Answers 0 01-18-2006 01:15 AM
how to request a "read" or "delivered" receipt for mails plelie2 Shell Programming and Scripting 1 08-06-2002 12:26 PM

Reply
 
Submit Tools LinkBack Thread Tools Search this Thread Display Modes
  #1  
Old 12-17-2007
Registered User
 

Join Date: May 2006
Posts: 25
Question Explain the line "mn_code=`env|grep "..mn"|awk -F"=" '{print $2}'`"

Hi Friends,

Can any of you explain me about the below line of code?

mn_code=`env|grep "..mn"|awk -F"=" '{print $2}'`

Im not able to understand, what exactly it is doing

Any help would be useful for me.

Lokesha
Reply With Quote
Forum Sponsor
  #2  
Old 12-17-2007
Registered User
 

Join Date: Nov 2007
Posts: 5
This will extract the lines having strings with "mn" at end

and print the first word after first "=" sign (which is the second column with = sign as column separator)

example

if
ODBCHOME=/usr/damn/odbc is set in your .profile file

then it will display /usr/damn/odbc
Reply With Quote
  #3  
Old 12-17-2007
Registered User
 

Join Date: May 2006
Posts: 25
Question

Thanks Karnan,

I've some more questions. Reqst you to answer these.
1) Why 'env' is used there?
2) This line of code is used in all the Control-M script, why they are searching for '..mn' (tow dot's).

Thanks in advance,
Lokesha
Reply With Quote
  #4  
Old 12-18-2007
ganapati's Avatar
Registered User
 

Join Date: Jul 2006
Posts: 114
Post

Correct me if Iam wrong.

env will shows the environmental variable values, and from that output grep is searching for '..mn'.

With Regards,
Ganapati
Reply With Quote
  #5  
Old 12-19-2007
Registered User
 

Join Date: Nov 2007
Posts: 5
env has the common path or other setting used by the scripts

two dots represents minimum 2 letters before mn [..mn]
Reply With Quote
Google The UNIX and Linux Forums
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes




All times are GMT -7. The time now is 03:17 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008. All Rights Reserved.Ad Management by RedTyger Visit The Complex Event Processing Blog

Content Relevant URLs by vBSEO 3.2.0