Sponsored Content
Full Discussion: Creating conditional symlink
Operating Systems Linux Ubuntu Creating conditional symlink Post 302738971 by sussus2326 on Monday 3rd of December 2012 08:56:57 AM
Old 12-03-2012
Thanks.

Alias will help to get the last 1000 lines dynamically. I am planning to expose this file using web server for external users to read. In this case will alias be helpful?

If there is any other approach please suggest.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

creating a script using the case conditional

hello, i am a newbie who is just starting to use liunx, and I need to accept a string from the terminal and use case to echo a suitable message if the string doesn't have at least 10 characters. Also, how would I do the same thing using expr? (3 Replies)
Discussion started by: soccerstr1
3 Replies

2. UNIX for Dummies Questions & Answers

creating conditional logs

Hi all, I am new to scripting and hope to get help in this forum...we use autosys ... the jil files call shell scripts (korn shell) for automated processes and create logs everytime they are run...the process runs every 5 mins which is creating huge logs...i need to know if logs be created... (0 Replies)
Discussion started by: sonali007
0 Replies

3. UNIX for Dummies Questions & Answers

creating symlink

hi... I have a folder<abc> under /root folder. I want to create a symlink such that when i click on folder<abc> under root, should display my home folder (home/krish). Immediate inputs appreciated..... (1 Reply)
Discussion started by: rama.honge
1 Replies

4. Shell Programming and Scripting

sed -i destroy symlink - how to solve this ?

After a few hours of frustration because I didn't understand why my symlinks are destroyed i just found out that sed -i will destroy symlinks. I searched but i didn't found any good solution for this. Is there any way to overcome this ? On my ubuntu server sed version is 4.1.5 edit: Sorry... (0 Replies)
Discussion started by: ktm
0 Replies

5. Solaris

symlink on link file

Hi all, I want to create a symlink on a link file, i mean, there is a file which is actually a symlink of some version. Now i want to create one more symlink on that link file. EX: there is a file: uat -> version prod -> version Now i want to create one more link on these 'uat' and... (1 Reply)
Discussion started by: raghu.iv85
1 Replies

6. Shell Programming and Scripting

ln -s creates symlink in symlink, if [ -f ... ] says file that exists doesn't exist

Hi Forums, I got a little problem, I made a few modifications to the code of the launch script of a testing server(minecraft) and now updating is broken aswell as the automatic directory creation. These Lines somehow create an endless symlink that refers to itself and I don't know how to fix... (0 Replies)
Discussion started by: Xaymar
0 Replies

7. UNIX for Dummies Questions & Answers

Remove symlink and target

i would like to remove a directory and also symlink target inside. my_directory -- file1 -> /targetpath/file1 -- file2 -> /targetpath/file2 rm -rf my_directory will not remove symlink target. rm -rf "`readlink -f file1`" will only remove target if specifying the symlink is specified ... (4 Replies)
Discussion started by: lsy
4 Replies

8. Shell Programming and Scripting

Symlink creation

I am trying to setup my plex server to use symlinks rather than host the movie files. in my storage directory, i have both movies(some in subdirectory of the name and some just in the parent directory) and tvshows, which have subdirectories for each season, which contains the episodes i would... (3 Replies)
Discussion started by: bandion
3 Replies

9. UNIX for Beginners Questions & Answers

Symlink

I know how to create a symlink but I am getting an error message that the file already exists. Also, my symlink doesn't point from target directory to the path correctly, Here is an example of the path to my folder structure path: cd /wkspce/wff/DEV/jobs/DEL the folder structure is: ... (3 Replies)
Discussion started by: dellanicholson
3 Replies

10. Shell Programming and Scripting

How to create symlink for latest file only?

Hello, On Solaris 10, here are entries for logs in httpd.conf ErrorLog "|/export/apache/apache-2.2.17/bin/rotatelogs -l -f /var/log/apache/error_log.%Y%m%d 86400" It keeps creating daily logs with below names - -rw-r--r-- 1 root root 1016747232 Apr 5 23:59... (16 Replies)
Discussion started by: solaris_1977
16 Replies
Method::Alias(3pm)					User Contributed Perl Documentation					Method::Alias(3pm)

NAME
Method::Alias - Create method aliases (and do it safely) SYNOPSIS
# My method sub foo { ... } # Alias the method use Method::Alias 'bar' => 'foo', 'baz' => 'foo'; DESCRIPTION
For a very long time, whenever I wanted to have a method alias (provide an alternate name for a method) I would simple do a GLOB alias. That is, # My method sub foo { ... } # Alias the method *bar = *foo; While this works fine for functions, it does not work for methods. If your class has a subclass that redefines "foo", any call to "bar" will result in the overloaded method being ignored and the wrong "foo" method being called. These are basically bugs waiting to happen, and having completed a number of very large APIs with lots of depth myself, I've been bitten several times. In this situation, the canonical and fasest way to handle an alias looks something like this. # My method sub foo { ... } # Alias the method sub bar { shift->foo(@_) } Note that this adds an extra entry to the caller array, but this isn't really all that important unless you are paranoid about these things. The alternative would be to try to find the method using UNIVERSAL::can, and then goto it. I might add this later if someone really wants it, but until then the basic method will suffice. That doing this right is even worthy of a module is debatable, but I would rather have something that looks like a method alias definition, than have to document additional methods all the time. Using Method::Alias Method::Alias is designed to be used as a pragma, to which you provide a set of pairs of method names. Only very minimal checking is done, if you wish to create infinite loops or what have you, you are more than welcome to shoot yourself in the foot. # Add a single method alias use Method::Alias 'foo' => 'bar'; # Add several method aliases use Method::Alias 'a' => 'b', 'c' => 'd', 'e' => 'f'; And for now, that's all there is to it. METHODS
import from => to, ... Although primarily used as a pragma, you may call import directly if you wish. Taking a set of pairs of normal strings, the import method creates a number of methods in the caller's package to call the real method. Returns true, or dies on error. SUPPORT
Bugs should always be submitted via the CPAN bug tracker <http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Method-Alias> For other issues, contact the maintainer AUTHORS
Adam Kennedy <cpan@ali.as> SEE ALSO
<http://ali.as/> COPYRIGHT
Copyright 2004, 2006 Adam Kennedy. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. The full text of the license can be found in the LICENSE file included with this module. perl v5.8.8 2006-07-15 Method::Alias(3pm)
All times are GMT -4. The time now is 11:29 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy