Sponsored Content
Top Forums UNIX for Dummies Questions & Answers Explain the line "mn_code=`env|grep "..mn"|awk -F"=" '{print $2}'`" Post 302151747 by karnan on Monday 17th of December 2007 06:23:09 AM
Old 12-17-2007
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
 

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

ls -laR | grep "^-" | awk '{print $9}'| grep "$.txt"

Hi, I don't know hot to make this command work: ls -laR | grep "^-" | awk '{print $9}'| grep "$.txt" It should return the list of file .txt It's important to search .txt at the end of the line, becouse some file name have "txt" in their name but have other extensions (13 Replies)
Discussion started by: DNAx86
13 Replies

2. Shell Programming and Scripting

cat $como_file | awk /^~/'{print $1","$2","$3","$4}' | sed -e 's/~//g'

hi All, cat file_name | awk /^~/'{print $1","$2","$3","$4}' | sed -e 's/~//g' Can this be done by using sed or awk alone (4 Replies)
Discussion started by: harshakusam
4 Replies

3. Shell Programming and Scripting

ps -ef | grep "string1" "string2" " "string3"

Hi all, can any one suggest me the script to grep multiple strings from ps -ef pls correct the below script . its not working/ i want to print OK if all the below process are running in my solaris system. else i want to print NOT OK. bash-3.00$ ps -ef | grep blu lscpusr 48 42 ... (11 Replies)
Discussion started by: steve2216
11 Replies

4. Shell Programming and Scripting

awk command to replace ";" with "|" and ""|" at diferent places in line of file

Hi, I have line in input file as below: 3G_CENTRAL;INDONESIA_(M)_TELKOMSEL;SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL My expected output for line in the file must be : "1-Radon1-cMOC_deg"|"LDIndex"|"3G_CENTRAL|INDONESIA_(M)_TELKOMSEL"|LAST|"SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL" Can someone... (7 Replies)
Discussion started by: shis100
7 Replies

5. Shell Programming and Scripting

how to use "cut" or "awk" or "sed" to remove a string

logs: "/home/abc/public_html/index.php" "/home/abc/public_html/index.php" "/home/xyz/public_html/index.php" "/home/xyz/public_html/index.php" "/home/xyz/public_html/index.php" how to use "cut" or "awk" or "sed" to get the following result: abc abc xyz xyz xyz (8 Replies)
Discussion started by: timmywong
8 Replies

6. Shell Programming and Scripting

grep with "[" and "]" and "dot" within the search string

Hello. Following recommendations for one of my threads, this is working perfectly : #!/bin/bash CNT=$( grep -c -e "some text 1" -e "some text 2" -e "some text 3" "/tmp/log_file.txt" ) Now I need a grep success for some thing like : #!/bin/bash CNT=$( grep -c -e "some text_1... (4 Replies)
Discussion started by: jcdole
4 Replies

7. UNIX for Dummies Questions & Answers

Using "mailx" command to read "to" and "cc" email addreses from input file

How to use "mailx" command to do e-mail reading the input file containing email address, where column 1 has name and column 2 containing “To” e-mail address and column 3 contains “cc” e-mail address to include with same email. Sample input file, email.txt Below is an sample code where... (2 Replies)
Discussion started by: asjaiswal
2 Replies

8. Shell Programming and Scripting

Bash script - Print an ascii file using specific font "Latin Modern Mono 12" "regular" "9"

Hello. System : opensuse leap 42.3 I have a bash script that build a text file. I would like the last command doing : print_cmd -o page-left=43 -o page-right=22 -o page-top=28 -o page-bottom=43 -o font=LatinModernMono12:regular:9 some_file.txt where : print_cmd ::= some printing... (1 Reply)
Discussion started by: jcdole
1 Replies

9. AIX

Apache 2.4 directory cannot display "Last modified" "Size" "Description"

Hi 2 all, i have had AIX 7.2 :/# /usr/IBMAHS/bin/apachectl -v Server version: Apache/2.4.12 (Unix) Server built: May 25 2015 04:58:27 :/#:/# /usr/IBMAHS/bin/apachectl -M Loaded Modules: core_module (static) so_module (static) http_module (static) mpm_worker_module (static) ... (3 Replies)
Discussion started by: penchev
3 Replies
DBIx::Class::Storage::DBI::ODBC::Microsoft_SQL_Server(3pUser Contributed Perl DocumentatDBIx::Class::Storage::DBI::ODBC::Microsoft_SQL_Server(3pm)

NAME
DBIx::Class::Storage::DBI::ODBC::Microsoft_SQL_Server - Support specific to Microsoft SQL Server over ODBC DESCRIPTION
This class implements support specific to Microsoft SQL Server over ODBC. It is loaded automatically by by DBIx::Class::Storage::DBI::ODBC when it detects a MSSQL back-end. Most of the functionality is provided from the superclass DBIx::Class::Storage::DBI::MSSQL. USAGE NOTES
Basic Linux Setup (Debian) sudo aptitude install tdsodbc libdbd-odbc-perl unixodbc In case it is not already there put the following in "/etc/odbcinst.ini": [FreeTDS] Description = FreeTDS Driver = /usr/lib/odbc/libtdsodbc.so Setup = /usr/lib/odbc/libtdsS.so UsageCount = 1 Set your $dsn in connect_info as follows: dbi:ODBC:server=<my.host.name>;port=1433;driver=FreeTDS;tds_version=8.0 If you use the EasySoft driver (<http://www.easysoft.com>): dbi:ODBC:server=<my.host.name>;port=1433;driver=Easysoft ODBC-SQL Server Basic Windows Setup Use the following $dsn for the Microsoft ODBC driver: dbi:ODBC:driver={SQL Server};server=SERVERSQL_SERVER_INSTANCE_NAME And for the Native Client: dbi:ODBC:driver={SQL Server Native Client 10.0};server=SERVERSQL_SERVER_INSTANCE_NAME Go into Control Panel -> System and Security -> Administrative Tools -> Data Sources (ODBC) to check driver names and to set up data sources. Use System DSNs, not User DSNs if you want to use DSNs. If you set up a DSN, use the following $dsn for connect_info: dbi:ODBC:dsn=MY_DSN MULTIPLE ACTIVE STATEMENTS
The following options are alternative ways to enable concurrent executing statement support. Each has its own advantages and drawbacks and works on different platforms. Read each section carefully. In order of preference, they are: o mars o dynamic_cursors o server_cursors METHODS
connect_call_use_mars Use as: on_connect_call => 'use_mars' in your connection info, or alternatively specify it directly: Your::Schema->connect ( $original_dsn . '; MARS_Connection=Yes', $user, $pass, \%attrs, ) Use to enable a feature of SQL Server 2005 and later, "Multiple Active Result Sets". See "Does DBD::ODBC support Multiple Active Statements?" in DBD::ODBC::FAQ for more information. This does not work on FreeTDS drivers at the time of this writing, and only works with the Native Client, later versions of the Windows MS ODBC driver, and the Easysoft driver. connect_call_use_dynamic_cursors Use as: on_connect_call => 'use_dynamic_cursors' Which will add "odbc_cursortype => 2" to your DBI connection attributes, or alternatively specify the necessary flag directly: Your::Schema->connect (@dsn, { ... odbc_cursortype => 2 }) See "odbc_cursortype" in DBD::ODBC for more information. If you're using FreeTDS, "tds_version" must be set to at least 8.0. This will not work with CODE ref connect_info's. WARNING: on FreeTDS (and maybe some other drivers) this will break "SCOPE_IDENTITY()", and "SELECT @@IDENTITY" will be used instead, which on SQL Server 2005 and later will return erroneous results on tables which have an on insert trigger that inserts into another table with an "IDENTITY" column. WARNING: on FreeTDS, changes made in one statement (e.g. an insert) may not be visible from a following statement (e.g. a select.) connect_call_use_server_cursors Use as: on_connect_call => 'use_server_cursors' May allow multiple active select statements. See "odbc_SQL_ROWSET_SIZE" in DBD::ODBC for more information. Takes an optional parameter for the value to set the attribute to, default is 2. WARNING: this does not work on all versions of SQL Server, and may lock up your database! At the time of writing, this option only works on Microsoft's Windows drivers, later versions of the ODBC driver and the Native Client driver. using_freetds Tries to determine, to the best of our ability, whether or not you are using the FreeTDS driver with DBD::ODBC. AUTHOR
See "AUTHOR" in DBIx::Class and "CONTRIBUTORS" in DBIx::Class. LICENSE
You may distribute this code under the same terms as Perl itself. perl v5.14.2 2011-05-10 DBIx::Class::Storage::DBI::ODBC::Microsoft_SQL_Server(3pm)
All times are GMT -4. The time now is 02:45 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy