Sponsored Content
Top Forums Shell Programming and Scripting What is wrong with tiny (g)awk line ?? Post 302606407 by tip78 on Sunday 11th of March 2012 09:19:27 AM
Old 03-11-2012
Quote:
Originally Posted by louisJ
Hi
I wish to capitalize the first letter or every word in a text file with:
Code:
gawk '{$0=gensub(/(\w)(\w*)/,toupper("\\1")"\\2","g");}' file.txt

But it doesn't work...:
target:
bla test Test TEST
yes nO Yes yes
restult:
bla test Test TEST
yes nO Yes yes
any idea? thanks
Code:
perl -pe 's/\b./\u$&/g' file.txt


Last edited by tip78; 03-11-2012 at 10:37 AM..
tip78
 

3 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

what is wrong with this line?

system ("$ssh '$perf_stats' < temp_pipe 2>&1 &"); I need to start and interact with my executable defined by perf_stats on a remote machine but not change my command line to that of the remote machine. temp_pipe is a node created by mknod -f temp_pipe (6 Replies)
Discussion started by: looza
6 Replies

2. Shell Programming and Scripting

what is wrong with this expr line

It keeps giving me expr syntax error. expr "${etherline }" : ’.*no match found’ 2>&1 >/dev/null Thanks in advance. (1 Reply)
Discussion started by: shadow_boi
1 Replies

3. Shell Programming and Scripting

what's wrong with my awk line?

] && { echo "The free mem need to be more than 2G" } (3 Replies)
Discussion started by: yanglei_fage
3 Replies
Test::Moose(3pm)					User Contributed Perl Documentation					  Test::Moose(3pm)

NAME
Test::Moose - Test functions for Moose specific features VERSION
version 2.0603 SYNOPSIS
use Test::More plan => 1; use Test::Moose; meta_ok($class_or_obj, "... Foo has a ->meta"); does_ok($class_or_obj, $role, "... Foo does the Baz role"); has_attribute_ok($class_or_obj, $attr_name, "... Foo has the 'bar' attribute"); DESCRIPTION
This module provides some useful test functions for Moose based classes. It is an experimental first release, so comments and suggestions are very welcome. EXPORTED FUNCTIONS
meta_ok ($class_or_object) Tests if a class or object has a metaclass. does_ok ($class_or_object, $role, ?$message) Tests if a class or object does a certain role, similar to what "isa_ok" does for the "isa" method. has_attribute_ok($class_or_object, $attr_name, ?$message) Tests if a class or object has a certain attribute, similar to what "can_ok" does for the methods. with_immutable { CODE } @class_names Runs CODE (which should contain normal tests) twice, and make each class in @class_names immutable in between the two runs. TODO
Convert the Moose test suite to use this module. Here is a list of possible functions to write immutability predicates anon-class predicates discovering original method from modified method attribute metaclass predicates (attribute_isa?) SEE ALSO
Test::More BUGS
See "BUGS" in Moose for details on reporting bugs. AUTHOR
Moose is maintained by the Moose Cabal, along with the help of many contributors. See "CABAL" in Moose and "CONTRIBUTORS" in Moose for details. COPYRIGHT AND LICENSE
This software is copyright (c) 2012 by Infinity Interactive, Inc.. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. perl v5.14.2 2012-06-28 Test::Moose(3pm)
All times are GMT -4. The time now is 06:44 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy