Sponsored Content
Top Forums Shell Programming and Scripting Define Aliases to tail many logs Post 302423648 by curleb on Friday 21st of May 2010 02:57:42 PM
Old 05-21-2010
doesn't tail -f require a console...? Not sure if it can be relied upon without an interactive window...

Meanwhile, methyl's suggestion is entirely valid, but before giving up entirely on the multi-pronged effort...you might want to note the syntax errors on the alias suggestions given above and correct these to csh syntax:
Code:
% alias my_date="date +%d%m%Y_%H%M;"

% echo $my_date
my_date: Undefined variable

% set my_date="date +%d%m%Y_%H%M;"

% alias spc1 'echo $my_date '             

% spc1
date +%d%m%Y_%H%M;

% set my_date `date +%d%m%Y_%H%M;`
set: Syntax error

% set my_date=`date +%d%m%Y_%H%M;`

% alias spc1 'echo $my_date '

% spc1
21052010_1439

% touch /tmp/$my_date.log

% ls -lgo /tmp/2*.log
-rw-rw----   1       0 May 21 14:47 /tmp/21052010_1439.log

 

10 More Discussions You Might Find Interesting

1. Programming

aliases

Hi. I have a C program that is using the **environ pointer and I am trying to set up aliases for a system("/bin/ksh") call. This works for other environment variables but not for the aliases. Does anyone know if this can be done? Thanks ahead of time. (1 Reply)
Discussion started by: mluey61
1 Replies

2. UNIX for Dummies Questions & Answers

aliases

Is there a way to view what aliases are running on a given session? (1 Reply)
Discussion started by: BG_JrAdmin
1 Replies

3. Shell Programming and Scripting

/etc/mail/aliases

HI I have 5000 users on sendmail server, also there entries of these users Mail ID in /etc/mail/aliases as per Diparments. Same Mail ID can occures in Diff Departments as per req. I have to remove 500 users from server also there entry from /etc/mail/aliases file. which occures many times. ... (1 Reply)
Discussion started by: Kumarsharad
1 Replies

4. UNIX for Dummies Questions & Answers

man aliases

Can any one show me how to create an alias account that silently copies local emails to the administrator (root) using a linux cmd line or GUI? The answer needs to be very simplly explained at this stage, as I am new to the command prompt...expecialy in linux. thanks heaps guys Pipa:) I... (2 Replies)
Discussion started by: Pipa
2 Replies

5. Shell Programming and Scripting

etc aliases

Hello: i have several server with own etc aliases. right now i want to combine it all into a general etc aliases in a new freebsd server. cause it consist hundred thousand of record user inside how to make a shell script to combine it or configure it. all etc aliases record example: ... (0 Replies)
Discussion started by: peterLfs
0 Replies

6. Shell Programming and Scripting

Grep yesterday logs from weblogic logs

Hi, I am trying to write a script which would go search and get the info from the logs based on yesterday timestamp and write yesterday logs in new file. The log file format is as follows: """"""""""""""""""""""""""... (3 Replies)
Discussion started by: harish.parker
3 Replies

7. HP-UX

[Solved] Aliases in HP-UX

Hi folks, How can I make an alias in HP-UX? I've tried to add something just like this bye='exit' (as example), the system accepted but when I write bye in the terminal its return with invalid command. When I make such alias in RedHat or Fedora the system accept it right there, what is the... (7 Replies)
Discussion started by: leo_ultra_leo
7 Replies

8. UNIX for Dummies Questions & Answers

Unsetting aliases

Within a session we have created some aliases. How to unset all the aliases in the session or specific alias? (1 Reply)
Discussion started by: pandeesh
1 Replies

9. Shell Programming and Scripting

Joining multiple files tail on tail

I have 250 files that have 16 columns each - all numbered as follows stat.1000, stat.1001, stat.1002, stat.1003....stat.1250. I would like to join all 250 of them together tail by tail as follows. For example stat.1000 a b c d e f stat.1001 g h i j k l So that my output... (2 Replies)
Discussion started by: kayak
2 Replies

10. Shell Programming and Scripting

If I ran perl script again,old logs should move with today date and new logs should generate.

Appreciate help for the below issue. Im using below code.....I dont want to attach the logs when I ran the perl twice...I just want to take backup with today date and generate new logs...What I need to do for the below scirpt.............. 1)if logs exist it should move the logs with extention... (1 Reply)
Discussion started by: Sanjeev G
1 Replies
HTML::Template::Plugin::Dot(3pm)			User Contributed Perl Documentation			  HTML::Template::Plugin::Dot(3pm)

NAME
HTML::Template::Plugin::Dot - Add Magic Dot notation to HTML::Template SYNOPSIS
use HTML::Template::Pluggable; use HTML::Template::Plugin::Dot; my $t = HTML::Template::Pluggable->new(...); Now you can use chained accessor calls and nested hashrefs as params, and access them with a dot notation. You can even pass arguments to the methods. For example, in your code: $t->param( my_complex_struct => $struct ); And then in your template you can reference specific values in the structure: my_complex_struct.key.obj.accessor('hash') my_complex_struct.other_key DESCRIPTION
By adding support for this dot notation to HTML::Template, the programmers' job of sending data to the template is easier, and designers have easier access to more data to display in the template, without learning any more tag syntax. EXAMPLES Class::DBI integration Class::DBI accessors can be used in the template. If the accessor is never called in the template, that data doesn't have to be loaded. In the code: $t->param ( my_row => $class_dbi_obj ); In the template: my_row.last_name This extends to related objects or inflated columns (commonly used for date fields). Here's an example with a date column that's inflated into a DateTime object: my_row.my_date.mdy('/') my_row.my_date.strftime('%D') Of course, if date formatting strings look scary to the designer, you can keep them in the application, or even a database layer to insure consistency in all presentations. Here's an example with related objects. Suppose you have a Customer object, that has_a BillingAddress object attached to it. Then you could say something like this: <tmpl_if customer.billing_address> <tmpl_var customer.billing_address.street> <tmpl_var customer.billing_address.city> ... </tmpl_if> More complex uses The dot notation allows you to pass arguments to method calls (as in the "my_date.dmy('/')" example above). In fact, you can pass other objects in the template as well, and this enables more complex usage. Imagine we had a (fictional) Formatter object which could perform some basic string formatting functions. This could be used in e.g. currencies, or dates. In your code: $t->param( Formatter => Formatter->new, order => $order_obj ); In your template: Amount: <tmpl_var Formatter.format_currency('US',order.total_amount)> (hint: see Number::Format) This even extends to references to plain tmpl_vars in your template: $t->param( Formatter => Formatter->new, plain => 'Jane' ); <tmpl_var Formatter.reverse(plain)> is <tmpl_var plain> backwards TMPL_LOOPs As of version 0.94, the dot notation is also supported on TMPL_LOOP tags (but see the "LIMITATIONS" section). Given an object method (or a hash key) that returns an array or a reference to an array, we will unwrap that array for use in the loop. Individual array elements are mapped to a hash "{ 'this' => $elt }", so that you can refer to them in TMPL_VARs as "this.something". An example might help. Let's use the canonical Class::DBI example for our data. Suppose you have an $artist object, which has_many CDs. You can now pass just the $artist object, and handle the loops in the template: $t->param( artist => $artist ); The template: <tmpl_var artist.name> has released these albums: <tmpl_loop artist.cds> <tmpl_var this.title> - <tmpl_var this.year> </tmpl_loop> As you can see, each element from the artist.cds() array is called "this" by default. You can supply your own name by appending ': name' like this: <tmpl_loop artist.cds:cd> <tmpl_var cd.title> ... That's not the end of it! You can even nest these loops, displaying the Tracks for each CD like so: <tmpl_loop artist.cds:cd> <tmpl_var cd.title> <tmpl_loop cd.tracks:track> - <tmpl_var track.title> ( <tmpl_var track.tracktime> ) </tmpl_loop> </tmpl_loop> LIMITATIONS o Casing of parameter names Casing of parameter names follows the option "case_sensitive" of HTML::Template. If you do not use that option, all parameter names are converted to lower case. I suggest turning this option on to avoid confusion. o Quotes and spaces Because of the way HTML::Template parses parameter names (which follows the rules of HTML attributes), you have to be careful when your expressions contain spaces or quote characters. You can say "<tmpl_var something.without.spaces>", but not "<tmpl_var something with spaces>". You can use single or double quotes around your entire expression, and then use the other one inside: "<tmpl_var name="some.method('with arguments')">" This is the recommended way to write your expressions. (Note: within expressions, the characters in "[`'"]" are recognised as quote characters. So if you need to pass literal quotes to a method, you could do it like this: "<tmpl_var name='some.method(`need a " here`)'>". ) PERFORMANCE No attempt to even measure performance has been made. For now the focus is on usability and stability. If you carry out benchmarks, or have suggestions for performance improvements, be sure to let us know! CONTRIBUTING
Patches, questions and feedback are welcome. This project is managed using the darcs source control system ( http://www.darcs.net/ ). A public darcs archive is here: http://cgiapp.erlbaum.net/darcs_hive/ht-pluggable/ AUTHORS
Mark Stosberg, <mark@summersault.com>; Rhesa Rozendaal, <rhesa@cpan.org> Copyright &; License Parts copyright 2006 Mark Stosberg Parts copyright 2006 Rhesa Rozendaal This program is free software; you can redistribute it and/or modify it under the same terms as perl itself. perl v5.10.1 2011-01-04 HTML::Template::Plugin::Dot(3pm)
All times are GMT -4. The time now is 09:24 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy