Tag Archives: SED

Using sed Command To parse output

By mnassiri

Hi
I have the following output and Ineed to get the variable that is assigned to CN in each line. I have access to SED utility. Can anyone help please?

Regards

“CN=BIS Helpdesk Mailbox_SendAs,OU=ExchangeShareMailboxesACL,OU=Groups,DC=ad,DC=btmna,DC=com”
“CN=BIS Helpdesk Mailbox_FullAccess,OU=ExchangeShareMailboxesACL,OU=Groups,DC=ad,DC=btmna,DC=com”
“CN=CPM Mailbox_SendAs,OU=ExchangeShareMailboxesACL,OU=Groups,DC=ad,DC=btmna,DC=com”
“CN=CPM Mailbox_FullAccess,OU=ExchangeShareMailboxesACL,OU=Groups,DC=ad,DC=btmna,DC=com”
“CN=SF Mailbox_SendAs,OU=ExchangeShareMailboxesACL,OU=Groups,DC=ad,DC=btmna,DC=com”
“CN=SF Mailbox_FullAccess,OU=ExchangeShareMailboxesACL,OU=Groups,DC=ad,DC=btmna,DC=com”

I need to get the name of the mail box indicated after the CN
For example: I need to ge this out put from line one
BIS Helpdesk Mailbox_SendAs

So anything after the CN= until the ,
The line starts with CN= and the text I’m interest in is between CN= and
the next occfurance of the , Comma

I’m using SED command with these options

Usage: sed [OPTION]… {script-only-if-no-other-script} [input-file]…
-n, –quiet, –silent
suppress automatic printing of pattern space
-e script, –expression=script
add the script to the commands to be executed
-f script-file, –file=script-file
add the contents of script-file to the commands to be ex
-i[suffix], –in-place[=suffix]
edit files in place (makes backup if extension supplied)
-l N, –line-length=N
specify the desired line-wrap length for the `l’ command
-r, –regexp-extended
use extended regular expressions in the script.
-s, –separate
consider files as separate rather than as a single conti
long stream.
–text switch to text mode
-u, –unbuffered
load minimal amounts of data from the input files and fl
the output buffers more often
–help display this help and exit
-V, –version output version information and exit
If no -e, –expression, -f, or –file option is given, …read more

Source: FULL ARTICLE at The UNIX and Linux Forums

sed help adding parenthis

By BeefStu

I have the following data and want to put parenthis around the numbers:

Code:


PARTITION PERIOD_MIN VALUES LESS THAN 10649 TABLESPACE ODS_DAILY_MF_AUM,
PARTITION PERIOD_10649 VALUES LESS THAN 10650 TABLESPACE ODS_DAILY_MF_AUM,
PARTITION PERIOD_10650 VALUES LESS THAN 10651 TABLESPACE ODS_DAILY_MF_AUM,
...
...
...


The output should look like this

Code:


PARTITION PERIOD_MIN VALUES LESS THAN (10649) TABLESPACE ODS_DAILY_MF_AUM,
PARTITION PERIOD_10649 VALUES LESS THAN (10650) TABLESPACE ODS_DAILY_MF_AUM,
PARTITION PERIOD_10650 VALUES LESS THAN 1(0651)TABLESPACE ODS_DAILY_MF_AUM,
...
...
...


Can somebody provide me with a SED or AWK statement that can do this in one shot.

Thanks to all who answer

…read more

Source: FULL ARTICLE at The UNIX and Linux Forums

sed not outputing variable into new file

By springs2

Hi all,

I have a script that creates folders depending on what variables i enter when calling the script. This all works as expected but what i want to do is add some additional data into another file so that other scripts are aware of this file.

I’ve found the following sed command which works to my needs. It enters the given details into a given line

Code:

sed "36amv -v $foo/"$SHOW" $bar/$SHOW/" test2.sh > test3.sh


the problem i’m having is that when the sed command has run, $SHOW displays still in the new file as $SHOW. Is there something i’m doing wrong as to why $SHOW wont “resolve” to the text i need to to be?

also is there an easier way to output the results of SED back into the original file? Instead of having to manipulate it in such a way that i end up with the original file name?

From: http://www.unix.com/shell-programming-scripting/221249-sed-not-outputing-variable-into-new-file.html

SED International Holdings Appoints Derrek Hallock SVP and GM U.S. Commercial Division

By Business Wirevia The Motley Fool

Filed under:

SED International Holdings Appoints Derrek Hallock SVP and GM U.S. Commercial Division

LAWRENCEVILLE, Ga.–(BUSINESS WIRE)– SED International Holdings, Inc. (NYSE MKT: SED), announced today that the Company has appointed Derrek P. Hallock as SVP and GM of the U.S. Commercial Division. The Commercial Division has responsibility to grow SED‘s business among the VAR, MSP and OEM communities. Mr. Hallock will be based in the company’s Atlanta area headquarters and will manage both the client sales and vendor management functions of the Commercial Division.

Last week SED announced that it is focusing its business on three areas: IT storage systems, small business IT solutions and merchandized e-commerce fulfillment. A major focus among these areas is the small business solutions market served by IT VAR‘s and MSP‘s. “Derrek is the ideal candidate to grow SED‘s penetration of the Small Business market in the U.S.,” said Bob O’Malley, President and CEO. “His experiences in supply chain management, VAR sales and Distributor Marketing Services are a perfect fit to our new focused strategy.”

Most recently Mr. Hallock was Tech Data’s Vice President of TDAgency, with direct responsibility for managing a $60 million full service marketing and advertising agency. TDAgency creates channel enabled marketing programs that bridge the demand connection between IT manufacturers and channel client objectives. Prior to TDAgency, Mr. Hallock had responsibility for Tech Data’s SMB VAR Sales managing operations in the U.S., Canada and Costa Rica. He has also held management positions at CompuCom Systems, Dixie Aerospace and American Airlines.

“I am delighted to be joining the SED International team and returning to a leadership role in the Small Business IT marketplace,” said Derrek Hallock. “Small Businesses across the U.S. have the same appetite for technology as large enterprises. With the right support from SED and our channel partners, they have the ability to implement leading IT solutions much faster. SED‘s strategy to leverage cloud services, storage applications and demand for mobile solutions will enable our clients to achieve profitable growth and further penetrate the SMB marketplace.”

ABOUT SED INTERNATIONAL HOLDINGS, INC.

Founded in 1980, SED International Holdings, Inc. is a multinational, preferred distributor of leading computer technology, consumer electronics, small appliances, housewares, and personal care products. The company also offers custom-tailored supply chain management services ideally suited to meet the priorities and distribution requirements of the e-commerce, Business-to-Business and Business-to-Consumer markets. Headquartered near Atlanta, Georgia with business operations in California; Florida; Georgia; New Jersey; Texas; Bogota, Colombia and Buenos …read more

Source: FULL ARTICLE at DailyFinance

SED International Holdings Announces Plans to Restructure U.S. Operations to Strengthen Long-term Co

By Business Wirevia The Motley Fool

Filed under:

SED International Holdings Announces Plans to Restructure U.S. Operations to Strengthen Long-term Competitive Position

LAWRENCEVILLE, Ga.–(BUSINESS WIRE)– SED International Holdings, Inc. (NYSE MKT: SED), announced today that the Company plans to strengthen its long-term competitive position through a restructuring of its United States operations. The restructuring initiatives will improve productivity and strengthen SED‘s commercial operations.

“The initiatives announced today are designed to accelerate SED‘s path to sustainable profitability,” said Bob O’Malley, SED Chief Executive Officer. “In addition to addressing the expense side of our business, SED is focusing its U.S. business on its three core competencies: IT storage systems, small business IT solutions and merchandized e-commerce fulfillment.”

“Since I began with SED two quarters ago, I have spoken about the need to improve our commercial services offerings by embracing cloud computing service models, by pursuing applications capitalizing on converged data, voice and video, and by leveraging the potential of mobile computing platforms,” continued Mr. O’Malley. “In addition to our IT related businesses, we are increasing our focus on fulfillment services for our retail clients. The initiatives we are undertaking now will allow us to invest in these strategic areas of growth and also improve our relationship with our strategic vendor and customer partners.”

Key elements of the plan include:

  • Focus the Company’s line card consistent with strategic opportunities in both our Commercial and Consumer businesses.
  • Reduce U.S. headcount and SG&A by over 25%.
  • Consolidate SED‘s 5 U.S. distribution centers into 3 distribution centers.

It is expected that this restructuring plan will result in gross profit dollars remaining consistent with the historical run rates while SG&A will decline by approximately 25%. This plan will not impact the recently adopted strategic growth plan in Latin America and will not affect the profitability of the Latin American business unit.

“The bold, decisive restructuring actions announced today are consistent with the long-term goals for SED‘s business,” said Samuel A. Kidston, SED‘s Chairman of the Board. “The Board fully supports these actions and believes that they are a very important step in returning the company to profitable growth, improving gross margins and driving improved Return On Invested Capital and shareholder value.”

More specific financial measures associated with the restructuring will be reviewed with the investor community at the SED Q3 Conference Call in May.

…read more

Source: FULL ARTICLE at DailyFinance

How to echo $variable into txt file?

By mogabrHello

i tried many times echo $variables into text file with no success

for example:

Code:
echo “#!/bin/sh

BBHTAG=RFOCLT_check # What we put in bb-hosts to trigger this test
COLUMN=RFOCLT # Name of the column, often same as tag in bb-hosts
$BBHOME/bin/bbhostgrep $BBHTAG | while read L
do
set $L # To get one line of output from bbhostgrep
HOSTIP=”$1″
MACHINEDOTS=”$2″
MACHINE=`echo $2 | $SED -e’s/./,/g’`” > test.sh
can you advice how to do that ?
Source: The UNIX and Linux Forums