Sponsored Content
Full Discussion: Optimize code in single line
Top Forums UNIX for Beginners Questions & Answers Optimize code in single line Post 303044679 by jim mcnamara on Sunday 1st of March 2020 09:11:33 AM
Old 03-01-2020
Optimization does not mean condensing several readable single commands into a less readable single line - which can be harder to maintain, say, in six months. When you have forgotten about it. And you have to come back for other changes - then you wonder what this 'optimized' code really does.

Crocodile indeed.
These 3 Users Gave Thanks to jim mcnamara For This Post:

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Optimize shell code

#!/usr/bin/perl use strict; use warnings; use Date::Manip; my $date_converted = UnixDate(ParseDate("3 days ago"),"%e/%h/%Y"); open FILE,">$ARGV"; while(<DATA>){ my @tab_delimited_array = split(/\t/,$_); $tab_delimited_array =~ s/^\ =~ s/^\-//; my $converted_date =... (2 Replies)
Discussion started by: sandy1028
2 Replies

2. Shell Programming and Scripting

pl help me to Optimize the given code

Pl help to me to write the below code in a simple way ... i suupose to use this code 3 to 4 places in my makefile(gnu) .. **************************************** @for i in $(LIST_A); do \ for j in $(LIST_B); do\ if ;then\ echo "Need to sign"\ echo "List A = $$i , List B =$$j"\ ... (2 Replies)
Discussion started by: pk_arun
2 Replies

3. Shell Programming and Scripting

Multiple lines in a single column to be merged as a single line for a record

Hi, I have a requirement with, No~Dt~Notes 1~2011/08/1~"aaa bbb ccc ddd eee fff ggg hhh" Single column alone got splitted into multiple lines. I require the output as No~Dt~Notes 1~2011/08/1~"aaa<>bbb<>ccc<>ddd<>eee<>fff<>ggg<>hhh" mean to say those new lines to be... (1 Reply)
Discussion started by: Bhuvaneswari
1 Replies

4. Shell Programming and Scripting

Joining multi-line output to a single line in a group

Hi, My Oracle query is returing below o/p ---------------------------------------------------------- Ins trnas value a lkp1 x a lkp1 y b lkp1 a b lkp2 x b lkp2 y ... (7 Replies)
Discussion started by: gvk25
7 Replies

5. Shell Programming and Scripting

Can someone please help me optimize my code (script searches subdirectories)?

Here is my code. What it does is it reads an input file (input.txt which contains roughly 2,000 search phrases) and searches a directory for files that contains the search phrase. The directory contains roughly 1900 files and 84 subdirectories. The output is a file (output.txt) that shows only the... (23 Replies)
Discussion started by: jl487
23 Replies

6. Shell Programming and Scripting

Formatting File having big single line into 95 Char Per Line

Hi All, I have 4 big files which contains one big line containing formatted character records, I need to format each file in such way that each File will have 95 Characters per line. Last line of each file will have newline character at end. Before:- File Name:- File1.dat 102 121340560... (10 Replies)
Discussion started by: lancesunny
10 Replies

7. Shell Programming and Scripting

sed command to grep multiple pattern present in single line and delete that line

here is what i want to achieve.. i have a file with below contents cat fileName blah blah blah . .DROP this REJECT that . --sport 7800 -j REJECT --reject-with icmp-port-unreachable --dport 7800 -j REJECT --reject-with icmp-port-unreachable . . . more blah blah blah --dport 3306... (14 Replies)
Discussion started by: vivek d r
14 Replies

8. UNIX for Dummies Questions & Answers

To find and display the middle line in a file using single line command.

Hi all, How can i display the middle line of a file using a single line command? (6 Replies)
Discussion started by: Lakme Pemmaiah
6 Replies

9. Shell Programming and Scripting

Looking to optimize code

Hi guys, I feel a bit comfortable now doing bash scripting but I am worried that the way I do it is not optimized and I can do much better as to how I code. e.g. I have a whole line in a file from which I want to extract some values. Right now what I am doing is : STATE=`cat... (5 Replies)
Discussion started by: Junaid Subhani
5 Replies

10. Shell Programming and Scripting

Optimize awk code

sample data.file: 0,mfrh_green_screen,1454687485,383934,/PROD/G/cicsmrch/sys/unikixmain.log,37M,mfrh_green_screen,28961345,0,382962--383934 0,mfrh_green_screen,1454687785,386190,/PROD/G/cicsmrch/sys/unikixmain.log,37M,mfrh_green_screen,29139568,0,383934--386190... (7 Replies)
Discussion started by: SkySmart
7 Replies
Gnome2::Canvas::Widget(3pm)				User Contributed Perl Documentation			       Gnome2::Canvas::Widget(3pm)

Gnome2::Canvas::Widget - Gtk2::Widgets as CanvasItems HIERARCHY
Glib::Object +----Glib::InitiallyUnowned +----Gtk2::Object +----Gnome2::Canvas::Item +----Gnome2::Canvas::Widget PROPERTIES
'anchor' (Gtk2::AnchorType : default "north-west" : readable / writable) 'height' (double : default 0 : readable / writable) 'size-pixels' (boolean : default false : readable / writable) 'widget' (Gtk2::Widget : default undef : readable / writable) 'width' (double : default 0 : readable / writable) 'x' (double : default 0 : readable / writable) 'y' (double : default 0 : readable / writable) ENUMS AND FLAGS
enum Gtk2::AnchorType o 'center' / 'GTK_ANCHOR_CENTER' o 'north' / 'GTK_ANCHOR_NORTH' o 'north-west' / 'GTK_ANCHOR_NORTH_WEST' o 'north-east' / 'GTK_ANCHOR_NORTH_EAST' o 'south' / 'GTK_ANCHOR_SOUTH' o 'south-west' / 'GTK_ANCHOR_SOUTH_WEST' o 'south-east' / 'GTK_ANCHOR_SOUTH_EAST' o 'west' / 'GTK_ANCHOR_WEST' o 'east' / 'GTK_ANCHOR_EAST' o 'n' / 'GTK_ANCHOR_N' o 'nw' / 'GTK_ANCHOR_NW' o 'ne' / 'GTK_ANCHOR_NE' o 's' / 'GTK_ANCHOR_S' o 'sw' / 'GTK_ANCHOR_SW' o 'se' / 'GTK_ANCHOR_SE' o 'w' / 'GTK_ANCHOR_W' o 'e' / 'GTK_ANCHOR_E' SEE ALSO
Gnome2::Canvas, Glib::Object, Glib::InitiallyUnowned, Gtk2::Object, Gnome2::Canvas::Item COPYRIGHT
Copyright (C) 2003-2004 by the Gtk2-Perl Team. This software is licensed under the LGPL; see Gnome2::Canvas for a full notice. perl v5.14.2 2011-11-16 Gnome2::Canvas::Widget(3pm)

Featured Tech Videos

All times are GMT -4. The time now is 02:05 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy