Sponsored Content
Top Forums Shell Programming and Scripting Script solution as singleline ? Post 302971536 by msuluhan on Thursday 21st of April 2016 11:49:58 AM
Old 04-21-2016
Script solution as singleline ?

Hello

My script has following line and output
Code:
find path -type d | awk -F "/" 'NF == 4{print $3}'
path/custype=Type1/logdate=20160414
path/custype=Type11122/logdate=20160414

But I need following output that I need custtype information between "" like
Code:
path/custype="Type1"/logdate=20160414
path/custype="Type11122"/logdate=20160414

There is no constant value length for custtype.
So is there any solution within awk/sed or any command?

Thanks
 

5 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Please suggest a script or solution?

I have to solve a programming problem for my wife who is engaged in Research in Breast Cancer. 1. She has frequently to search a long single line of alphabetic characters (lower case) for an exact match of a string. e.g.... (4 Replies)
Discussion started by: nmsinghe
4 Replies

2. UNIX for Dummies Questions & Answers

How to get the script corrected to get the solution

Can anyone help it out, My Requirement: Actually i grep for the items in the atrblist (Result of it will provide the line where the item present and also the next line of where it presents)then it will be stored in $i.txt From tat result i wil grep 2nd word after getdate() word and store... (2 Replies)
Discussion started by: prsam
2 Replies

3. Shell Programming and Scripting

Merge multiline into Singleline

Hi, I'm newbie in this forum and I already searched regarding Merge multiline into singleline but I always found different result which is I don't want it like i want. Here is the data that i have it: *** ALARM 711 A1/BTS "MAD08B1 08ACPA0"U 090604 1040 RADIO X-CEIVER ADMINISTRATION BTS... (5 Replies)
Discussion started by: inteliduy
5 Replies

4. Shell Programming and Scripting

Perl script solution

Hi I need to do this thing in awk (or perl?). I try to find out how can I identify 1st and 2nd result from the OR expression in gensub: block='title Sata Mandriva kernel /boot/vmlinuz initrd /boot/initrd.img' echo "$block" | awk '{ x=gensub(/(kernel|initrd) /,"\\1XXX","g"); print x }' ... (12 Replies)
Discussion started by: webhope
12 Replies

5. Shell Programming and Scripting

Convert Singleline to Multilines

Hi All, Could you please help to get the below output: Input: J1,ELLA_1,ISDR,JJK,TRS J2,ROSTER,JACK J3,HUP ... ... ... Output: J1,ELLA_1 J1,ISDR J1,JJK J1,TRS (3 Replies)
Discussion started by: unme
3 Replies
Test::Script(3) 					User Contributed Perl Documentation					   Test::Script(3)

NAME
Test::Script - Basic cross-platform tests for scripts DESCRIPTION
The intent of this module is to provide a series of basic tests for 80% of the testing you will need to do for scripts in the script (or bin as is also commonly used) paths of your Perl distribution. Further, it aims to provide this functionality with perfect platform-compatibility, and in a way that is as unobtrusive as possible. That is, if the program works on a platform, then Test::Script should always work on that platform as well. Anything less than 100% is considered unacceptable. In doing so, it is hoped that Test::Script can become a module that you can safely make a dependency of all your modules, without risking that your module won't on some platform because of the dependency. Where a clash exists between wanting more functionality and maintaining platform safety, this module will err on the side of platform safety. FUNCTIONS
script_compiles script_compiles( 'script/foo.pl', 'Main script compiles' ); The "script_compiles" test calls the script with "perl -c script.pl", and checks that it returns without error. The path it should be passed is a relative unix-format script name. This will be localised when running "perl -c" and if the test fails the local name used will be shown in the diagnostic output. Note also that the test will be run with the same perl interpreter that is running the test script (and not with the default system perl). This will also be shown in the diagnostic output on failure. script_runs script_runs( 'script/foo.pl', 'Main script runs' ); The "script_runs" test executes the script with "perl script.pl" and checks that it returns success. The path it should be passed is a relative unix-format script name. This will be localised when running "perl -c" and if the test fails the local name used will be shown in the diagnostic output. The test will be run with the same perl interpreter that is running the test script (and not with the default system perl). This will also be shown in the diagnostic output on failure. SUPPORT
All bugs should be filed via the bug tracker at <http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Test-Script> For other issues, or commercial enhancement and support, contact the author. AUTHOR
Adam Kennedy <adamk@cpan.org> SEE ALSO
prove, <http://ali.as/> COPYRIGHT
Copyright 2006 - 2009 Adam Kennedy. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. The full text of the license can be found in the LICENSE file included with this module. perl v5.16.3 2009-11-24 Test::Script(3)
All times are GMT -4. The time now is 09:40 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy