Sponsored Content
Top Forums Shell Programming and Scripting [[HelloInCapitals]] to [[Hello In Capitals]] Post 302360168 by aigles on Thursday 8th of October 2009 08:36:31 AM
Old 10-08-2009
Smilie
Just a little improvement to avoid iuseless spaces before and after [[ ]]
Code:
echo '[[HelloInCapitals]] or [[PharmaceuticalSocietyOfGreatBritainVBoots1952]]' | 
nawk -F'(\\[\\[)|(\\]\\])' '{for(i=2;i<=NF;i+=2) {gsub("[A-Z]", " &", $i);$i="[["substr($i,2)"]]"};print}' OFS=""

Jean-Pierre.
 

We Also Found This Discussion For You

1. UNIX for Dummies Questions & Answers

Directory find in small and capitals

I've a very trivial thing bothering me. I'm rather new in scripting so I'll keep asking stupid questions. Here is small script that does backup of mails. --- for i in `cat /maildir.dir` do echo $i maildir=`echo $i|sed 's@^./usr/@@'` for j in $i/* do && { st="`find $j/backup -name "*"... (3 Replies)
Discussion started by: nitin
3 Replies
snmpsession(3)						     Library Functions Manual						    snmpsession(3)

NAME
snmpsession - snmpkit functions dealing with a particular snmpsession. SYNOPSIS
#include <snmpkit.h> SNMPSESSION *sk_new_session(char *host, void *(start_routine)(SNMPSESSION*), const char *community); DESCRIPTION
A snmpsession is an opaque data structure which specifies a The new_snmpsession() creates a new session. The SNMPSOCK should have previously created by the application using, new_snmpsock(). The host should will be looked up using gethostbyname() and the community string is something like a password in SNMP lingo but it doesn't have a username associated with it and it is transmitted in clear text within the packets. In most cases, there are a couple of community strings. One is only allowed to read and the other is allowed to both read and write. The default read-only community name is "public". If set the community name to NULL, the community name will default to public. The new_snmpsession_quick() function is very similar to the new_snmpsession() function except the community name always defaults to "pub- lic". The delete_snmpsock() function is the opposite of the new_snmpsession() function. It frees all memory and resources currently being used by the SNMPSESSION structure. RETURN VALUE
The new_snmpsock() and the new_snmpsock_quick() both return a pointer to the newly created snmpsock or NULL if there was an error. AUTHOR
Ben Woodard <ben@users.sourceforge.net> BUGS
The library can possibly throw different kinds of C++ exceptions that won't be caught by the glue code and therefore it can cause your pro- gram to crash inexplicably. SEE ALSO
libsnmpkit(3), snmpsock(3), snmpstructfiller(3), snmptable(3), gethostbyname(3) GNU snmpkit 0.4 November 2000 snmpsession(3)
All times are GMT -4. The time now is 10:18 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy