Sponsored Content
Top Forums Shell Programming and Scripting awk one liners into a nice script Post 302852721 by Jotne on Thursday 12th of September 2013 09:26:25 AM
Old 09-12-2013
As long as we do not have input data and desired output data, its difficult to shorten them.
 

7 More Discussions You Might Find Interesting

1. Programming

nice command and nice() system call

Hi I want to implement the nice command in the shell that I am building. I came to know that there is a corresponding nice() system call for the same. But since I will be forking different processes to run different commands typed on the command prompt, is there any way I can make a command... (2 Replies)
Discussion started by: tejbuch
2 Replies

2. UNIX for Dummies Questions & Answers

How to Turn perl one-liners into full perl script?

I have the following command prompt perl one liner: perl -e 's/\(\)\\,\"]//g; s/^\s//g; s/;/\n/g' -pi result1 I tried to move this one liner into a perl script I am practicing with (just started learning perl right now). I tried the following (I only know how to open a file and output to a... (1 Reply)
Discussion started by: EDALBNUG
1 Replies

3. Red Hat

KSH script help needed ( nice error trap routine ?)

I am running a script that runs a loop and executes a command on ${i} until the end of the for loop. From time to time the command generates an error ( which is good) for example ERROR0005: How can I trap the error and send an email echoing the ${i} variable in the loop and the error ? ... (2 Replies)
Discussion started by: pcpinkerton
2 Replies

4. 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

5. Shell Programming and Scripting

Set nice value in an executable in a script?

Is it possible to set a nice value for an executable in a script so that every time the executable runs it has this nice value? I'm trying to set aerender (After Effects terminal renderer) to run at +18 by replacing the original aerender script with a bash script with something like this in it: ... (3 Replies)
Discussion started by: scribling
3 Replies

6. 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

7. AIX

Useful and nice script for AIX,but outdated

How can I quickly see disk usage for my entire system? - IBM: AIX FAQ - Tek-Tips I tried it on aix7.1with ./script -dand give me VG PV size used free location Description rootvg 128 397 149 rootvg 128 212 334 ... (1 Reply)
Discussion started by: Linusolaradm1
1 Replies
ExtUtils::XSSymSet(3pm) 				 Perl Programmers Reference Guide				   ExtUtils::XSSymSet(3pm)

NAME
ExtUtils::XSSymSet - keep sets of symbol names palatable to the VMS linker SYNOPSIS
use ExtUtils::XSSymSet; $set = new ExtUtils::XSSymSet; while ($sym = make_symbol()) { $set->addsym($sym); } foreach $safesym ($set->all_trimmed) { print "Processing $safesym (derived from ",$self->get_orig($safesym),") "; do_stuff($safesym); } $safesym = ExtUtils::XSSymSet->trimsym($onesym); DESCRIPTION
Since the VMS linker distinguishes symbols based only on the first 31 characters of their names, it is occasionally necessary to shorten symbol names in order to avoid collisions. (This is especially true of names generated by xsubpp, since prefixes generated by nested package names can become quite long.) "ExtUtils::XSSymSet" provides functions to shorten names in a consistent fashion, and to track a set of names to insure that each is unique. While designed with xsubpp in mind, it may be used with any set of strings. This package supplies the following functions, all of which should be called as methods. new([$maxlen[,$silent]]) Creates an empty "ExtUtils::XSSymset" set of symbols. This function may be called as a static method or via an existing object. If $maxlen or $silent are specified, they are used as the defaults for maximum name length and warning behavior in future calls to addsym() or trimsym() via this object. addsym($name[,$maxlen[,$silent]]) Creates a symbol name from $name, using the methods described under trimsym(), which is unique in this set of symbols, and returns the new name. $name and its resultant are added to the set, and any future calls to addsym() specifying the same $name will return the same result, regardless of the value of $maxlen specified. Unless $silent is true, warnings are output if $name had to be trimmed or changed in order to avoid collision with an existing symbol name. $maxlen and $silent default to the values specified when this set of symbols was created. This method must be called via an existing object. trimsym($name[,$maxlen[,$silent]]) Creates a symbol name $maxlen or fewer characters long from $name and returns it. If $name is too long, it first tries to shorten it by removing duplicate characters, then by periodically removing non-underscore characters, and finally, if necessary, by periodically removing characters of any type. $maxlen defaults to 31. Unless $silent is true, a warning is output if $name is altered in any way. This function may be called either as a static method or via an existing object, but in the latter case no check is made to insure that the resulting name is unique in the set of symbols. delsym($name) Removes $name from the set of symbols, where $name is the original symbol name passed previously to addsym(). If $name existed in the set of symbols, returns its "trimmed" equivalent, otherwise returns "undef". This method must be called via an existing object. get_orig($trimmed) Returns the original name which was trimmed to $trimmed by a previous call to addsym(), or "undef" if $trimmed does not correspond to a member of this set of symbols. This method must be called via an existing object. get_trimmed($name) Returns the trimmed name which was generated from $name by a previous call to addsym(), or "undef" if $name is not a member of this set of symbols. This method must be called via an existing object. all_orig() Returns a list containing all of the original symbol names from this set. all_trimmed() Returns a list containing all of the trimmed symbol names from this set. AUTHOR
Charles Bailey <bailey@newman.upenn.edu> REVISION
Last revised 14-Feb-1997, for Perl 5.004. perl v5.12.1 2010-04-26 ExtUtils::XSSymSet(3pm)
All times are GMT -4. The time now is 08:56 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy