Sponsored Content
Full Discussion: One liners, quick rant...
The Lounge What is on Your Mind? One liners, quick rant... Post 302977435 by rbatte1 on Monday 18th of July 2016 06:45:03 AM
Old 07-18-2016
I've learned the hard way that compressing my code to the extreme just confuses myself when I need to change it. Do I really want 2 hours of extricating myself for a few extra lines of clear code that cost no noticeable time.

There is a case for a one-liner if you can get a tool such as awk to do several things at once rather than calling a loop with multiple greps or cuts being called within it. For me it comes down to using it for processing efficiency. Even if I can make my code fit into fewer blocks on disk, it's just not worth it. If I do, then it gets an explicit comment, often with example code it is logically replacing. If I can adjust it in future in a longer method, then conversion would be simpler if I get my requirements clearer first.

It's the same with debugging logs for batch programs - write lots of info to the log so that when there is a problem, the trace is there. Just make sure you clean up old logs after a short time to avoid running out of space. It's far better than trying to trace or reproduce an error, potentially altering your data for the worse on each attempt or having to put trace information in when an error occurs and you are bleary-eyed.



Robin
 

4 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Where can I rant?

First of all, apologies to the admins for not reading the rules totally and missing the bit about ranting off about other OSs. But that raises a question. Where do you go to have a good rant, to vent your disgust at various corporations and thier hideous behaviour? :confused: (2 Replies)
Discussion started by: u6ik
2 Replies

2. Shell Programming and Scripting

awk - one liners

Guys, I have a requirement like this. A file has >5K records always. Separated by "|", it has 30 fields for each line. In some lines, I am getting an odd field. say, the 15th field is supposed to be 2 characters but comes in as >2. In this case, for resolving this I need to copy the value of... (6 Replies)
Discussion started by: PikK45
6 Replies

3. What is on Your Mind?

Those simple one liners

I wanted to say LOL and punch my face when I saw post#11 (where Don_Cragun even reduced the string manipulation with a simple regex) in the thread https://www.unix.com/shell-programming-scripting/220553-add-0-start-filename-2.html I mean, when things can be done with just a one liner, sometimes I... (6 Replies)
Discussion started by: ahamed101
6 Replies

4. What is on Your Mind?

A rant...

Hi guys... (Apologies for any typos etc...) This is basically a rant. I have been doing kids level projects and writing code to suit since around 1982, for the uProfessor, for the Sinclair Spectrum and later for the QL, IBM-XT in MS-DOS and after that for a 386DX40 up to Windows 95, until I... (3 Replies)
Discussion started by: wisecracker
3 Replies
uucpsend(8)							Programmer's Manual						       uucpsend(8)

NAME
uucpsend - Alternative frontend for uucp batching SYNOPSYS
uucpsend [ -c config ] [ -f appendix ] sitename [ sitename ... ] This program offers a comfortable way to do news batching with the INN news system. Like the name assumes it is used for sites that are connected via UUCP. The idea behind the mechanism is taken from the nntpsend program which is already included in distributions of INN. The program does not do the batching itself. Instead it lets commonly used tools do the work. However it controls their behaviour. Using uucpsend you can define detailed how batching for each site shall take place in an easy fashion. In the file uucpsend.ctl(5) for each site your server feeds you can specify the size of batches, the maximal disk space that may be used by the uucp site, the header that should be written in the batch (e.g. funbatch, cunbatch, gunbatch etc.), the compression program to use as well as additional arguments passed to uux(8). The sitename should be the name of the site as specified in the newsfeeds(5) file. If no sitenames are passed to the program it will loop over all sites that described in the configuration file. This makes it easy to maintain sets of sites that are to be batched one after the other - contrary to batching through the whole day. A batcher(8) is launched for sites with queued news. Output is sent to the file /var/log/news/uucpsend.log. In order to keep from over- whelming the local system, uucpsend waits five seconds before the next site is fed. Uucpsend expects that the batchfile for a site is named /var/spool/news/out.going/sitename. To prevent batchfile corruption, shlock(1) is used to ``lock'' these files. It is useful to have cron(8) invoke uucpsend. When no sites are given on the command line, any flags given on the command completely describe how batcher operate. When no sites are given on the command line, then the information found in uucpsend.ctl becomes the default flags for that sites. OPTIONS
-f config Using this parameter you are able to specify a file different to PATH_UUCPCTL which defaults to /etc/news/uucpsend.ctl. -f appendix With the parameter ``-f'' you may specify another uucpsend.ctl(5) file. Information with regard to also given sitenames are read from the uucpsend.ctl-file. Please keep in mind that all default values are still read from the main uucpsend.ctl file. This fea- ture has been added to let big sites easily specify a different batching behaviour. HISTORY
Written by Martin Schulze <joey@infodrom.org>, derived mostly from nntpsend(8) by Landon Curt Noll <chongo@toad.com> and Rich $alz <rsalz@uunet.uu.net> for InterNetNews. SEE ALSO
innxmit(1), newsfeeds(5), uucpsend.ctl(5), nntppsend(8), nntppsend.ctl(5), shrinkfile(1). Infodrom 21 November 2001 uucpsend(8)
All times are GMT -4. The time now is 10:23 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy