The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

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 03:00 PM
grep to find content in between curly braces, "{" and "}," keshav_rk Shell Programming and Scripting 4 08-09-2007 10:14 PM
how could i make a program mixed with many "|", "<" and ">" strugglingman High Level Programming 2 04-29-2006 08:11 AM
No utpmx entry: you must exec "login" from lowest level "shell" peterpan UNIX for Dummies Questions & Answers 0 01-18-2006 04:15 AM
how to request a "read" or "delivered" receipt for mails plelie2 Shell Programming and Scripting 1 08-06-2002 03:26 PM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 12-17-2007
Lokesha Lokesha is offline
Registered User
  
 

Join Date: May 2006
Posts: 26
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
  #2 (permalink)  
Old 12-17-2007
karnan karnan is offline
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
  #3 (permalink)  
Old 12-18-2007
Lokesha Lokesha is offline
Registered User
  
 

Join Date: May 2006
Posts: 26
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
  #4 (permalink)  
Old 12-18-2007
ganapati's Avatar
ganapati ganapati is offline
Registered User
  
 

Join Date: Jul 2006
Location: Mysore
Posts: 125
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
  #5 (permalink)  
Old 12-20-2007
karnan karnan is offline
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]
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

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
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 05:26 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0