Sponsored Content
Top Forums Shell Programming and Scripting ksh String Manipulation - removing variables from within a variable Post 303029981 by MadeInGermany on Monday 4th of February 2019 05:35:36 AM
Old 02-04-2019
Right, I forgot to set the extglob!
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

extract from string variable into new variables

I have a variable which consists of a string like this: 001 aaabc 44 a bbb12 How do I extract each substring, delimited by the spaces, into new variables - one for each substring? eg var1 will be 001, var2 will be aaabc, var3 will be 44, var4 will be a, etc? I've come up with this:... (2 Replies)
Discussion started by: Sniper Pixie
2 Replies

2. Shell Programming and Scripting

KSH split string into variables

Hello, I am an intermediate scripter. I can usually find and adapt what I need by searching through previous postings, but I'm stumped. I have a string with the format "{Name1 Release1 Type1 Parent1} {Name2 Release2 Type2 Parent2}". It is being passed as an argument into a ksh script. I need to... (5 Replies)
Discussion started by: drd_2b
5 Replies

3. UNIX for Dummies Questions & Answers

String manipulation using ksh

I have a UNIX shell where: LEVEL=dev SITE=here and WHEREIAM=/tmp/$SITE/location/$LEVEL I want to echo $WHEREIAM in such a way that I get it back with all the environment variables resolved (/tmp/here/location/dev). This command will be used in a shell script. (5 Replies)
Discussion started by: zambo
5 Replies

4. Shell Programming and Scripting

string manipulation in ksh

Hi all, I'm trying to extract the name of a script that is being run with a full path. i.e. if the script name is /some/where/path/script_name.ksh I'd like to extract only: script_name i know that it is possible to do so in two phases: echo "${0##*/}" will give me script_name.ksh and... (4 Replies)
Discussion started by: iceman
4 Replies

5. Shell Programming and Scripting

Bash string variable manipulation

In a bash script I've set a variable that is the directory name of where an executable lives. the_dir=`dirname $which myscript` which equates to something like "/path/to/dir/bin" I need to cut that down to remove the "bin" so I now have "/path/to/dir/". This sounds easy but as a... (2 Replies)
Discussion started by: Witty
2 Replies

6. Shell Programming and Scripting

Bash:How to split one string variable in two variables?

Hello, I have a paramter $param consisting just of two literals and want to split it into two parameters, so I can combine it to a new parameter <char1><string><char2>, but the following code didn't work: tmp_PARAM_1=cut -c1 $PARAM tmp_PARAM_2=cut -c2 $PARAM... (2 Replies)
Discussion started by: ABE2202
2 Replies

7. Shell Programming and Scripting

Ksh in Linux Removing: "\0" From String

Hi All, I am facing a problem and I am not able to solve it. I have already searched google, but nothing (maybe I am not using the correct key words). As a database query result, I have a file like below: fmv:/home/fmv/tmp>cat TestBackRef.txt /^TEST\(\{4\}\)X\{12\}Y\.txt$/\0#\1/#Test... (2 Replies)
Discussion started by: felipe.vinturin
2 Replies

8. Shell Programming and Scripting

String manipulation using ksh script

Hi, I need to convert string "(joe.smith" into "joe_smith" i.e. I need to remove the leading opening brace '(' and replace the dot '.' with an under score '_' can anyone suggest a one liner ksh script or unix command for this please (3 Replies)
Discussion started by: sdj
3 Replies

9. Shell Programming and Scripting

How to convert string(variable) into date( epoch) in ksh on HPUX machine?

Hi all, I have used a bash script which ultimately converts a string into date using date --date option: DATE=$DATE" "$TIME" "`date +%Y` //concatenating 2 strings TMRW_DATE=`date --date="$DATE" +"%s"` //applying date command on string and getting the unixtime Please use code tags... (7 Replies)
Discussion started by: Rashu123
7 Replies

10. Shell Programming and Scripting

Variable string manipulation

Hi, I have a variable with grep output like this: WORDS=$(grep -r -c -i -E "palindrom" /"$DIRECTORY"/) so "echo "$WORDS"" could be: //directory/file1.txt:0 //directory/file2.txt:0 //directory/file3.txt:3 //directory/file4.txt:1 //directory/file5.txt:0 I need to "sed" my variable... (3 Replies)
Discussion started by: Hornys
3 Replies
asused(3pm)						User Contributed Perl Documentation					       asused(3pm)

NAME
asused - summaries address space used and according to the RIPE DB and REG. SYNOPSIS
asused [--all] [--aw | --approval] [--overlap] [--status | --assign[--pipa] ] regid asused [--all] [--aw | [--approval] [--overlap] [--status | --assign [--pipa] ] [--regid regid] (prefix ...) asused [--<options>] regid | prefix DESCRIPTION
asused is a tool to summaries address space is registered in the RIPE database. For each allocated inetnum object a summary of used and free address space is printed. A grant total summary for all prefixes is also provided. If there are no errors in locating allocations and and assignments under an allocation. In in the total % are calculated on total allocations. where: regid is name of registry as in registry database. prefix is allocation as in whois database. e.g. a.b.c/16 . Prefix is queried whois DB to find all Less specific matches inetnum with na as netname is interpreted as allocation and summerize the allocation. OPTIONS
--assign print all assignments under allocations, size, date and net name . Summary of assignments. And free address space. Summary of status attribute. --all this same as three options --overlap --status --aw. --approval Check the all networks in allocations are valid or not. Print valid and invalid networks. --aw only print invalid networks. --aw Check the all networks in allocations are valid or not. Print only Invalid networks. --approval will print valid and invalid. --contacts print admin-c/tech-c for all inetnums --help Shows the usage of asused. --overlap print the details of overlapping assignments. Summary of overlap per assignment is printed at the end. --reg regid. regid to locate the allocation. Netname of allocation is same as regid, translating the first '.' to '-' IN upper case. If not specified uses i2r to get regid. --status show assignments under allocations with wrong status attribute other than ASSIGNED PA or PI. MISSING for missing status. size and net name. Summary of assignments. No of Assignment(s) , No Assignments with status ASSIGNED PA or ASSIGNED PI, No Assignments with status ASSIGNED PI,No Assignments, No Assignments with Missing status attribute,No Assignments with other values status attribute, none of other . Warnings on assignments. OTHER OPTIONS
as3-option --port port query another whois server on the port. Default is 43. --host whoishost query another whois server. Default is whois.ripe.net. Can query only to RIPE whois server. Server version tested '2.1' --na netname show event table for approval of netname. Used with --aw or --approval -pipa additional flag to the --assign option to print allocation status in output. PA is for ALLOCATED PA, PI - ALLOCATED PI, UN for UNSPECIFED, -- is for missed status field. --version print version of asused. DIAGNOSTICS
No allocations from reg Could not locate any allocations in use from registry. No allocations from DB No inetnum object was recognized as allocation in the RIPE Database. % No entries found for the selected source(s). No assignment(s) found under the allocation. May be a new allocation or allocation which has no objects in RIPE DB. Not sure to treat as 100 % free. ERROR MISMATCH Netname regid RIPE DB Netame attribute has mismatch with na or regid. ERROR STATUS May be incorrect status attribute in the RIPE DB, Valid status ALLOCATED (PA|PI|UNSPECIFIED) ERROR mnt-byInvalid <mnt-by> attribute in RIPE DB expecting RIPE-NCC-MNT|RIPE-NCC-HM-MNT|RIPE-NCC-HM-PI-MNT Inconsistent with inetnum Encountered two inetnum objects with same logical start and end. Logical interpretation of inetnum a.b.c.0 => a.b.c.0 - a.b.c.255; a.b.c.0 - a.b.d.0 => a.b.c.0 - a.b.d.255 Classfull notation Intrepreted as class full object. Check if no of address are counted correctly. Multiple inetnum When tried to locate an allocation inetnum object for regid prefix from RIPE DB with option -L -F -T prefix returned multiple objects. Every prefix can have only one allocation object. NOT Counted Assignment If the assignment is outside the boundaries of allocation. It was returned by -M query RIPE whois server. Invalid inetnum Logical interpretation of inetnum fails. Probably can not identify start, end of end < start. Assignments has Invalid Date one of the dates of inetnum in the changed attribute is invalid. REQUIRES
Perl 5.00404 or later. Connection to RIPE whois server V 2.1, Perl Modules Socket Getopt::Long, regread, ipv4pack BUGS
Could give incorrect summary if logical interpretation of Inetnum is not exact a.b.c.0 - a.b.c.0 is intended to be an assignment of size 1 IP No. Out of memory! Noticed that when the no of assignments are very large, like 5000+ per allocation default data segment size of BSDI 3.1 is not enough. Increasing to 64 M Bytes may help. in bash shell ulimit -d 65536 eg. de.schlund IANA Delegated blocks smaller than /8 If the allocations are outside 192,193,194,195,212 /8 and LIR allocation is same inetnum as in /ncc/ip-reg/delegations asused2 will return No allocations in RIPE DB. eg. de.callisto SEE ALSO
whois reg i2r regread Reg::Asused Reg::Approved Net::RIPEWhois AUTHOR
Antony Antony <antony@ripe.net> . RIPE NCC software group. <softies@ripe.net> POD ERRORS
Hey! The above document had some coding errors, which are explained below: Around line 46: You forgot a '=back' before '=head1' Around line 66: You forgot a '=back' before '=head1' You forgot a '=back' before '=head1' Around line 95: You forgot a '=back' before '=head1' perl v5.10.1 2003-10-07 asused(3pm)
All times are GMT -4. The time now is 02:19 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy