08-07-2006
Alias commands
how do you alias a command... Like say I wanted kitten to exicute the command whoami. how would I do that?
Thank you for your time.
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
Hi, i want make 1 alias with two commands include to do two things at the same time like this:
ex: do finger and last at the same time with only one word finla or something.
Thanks.-
/home/seba > finger dustin
Login name: dustin In real life: Dustin Feldman
Directory:... (3 Replies)
Discussion started by: seba
3 Replies
2. UNIX for Dummies Questions & Answers
I've read the man on the alias command, and I am perplexed. I don't see a way to create an alias that will perform more than one command......is there a way to create an alias that is a string of a commands ? (1 Reply)
Discussion started by: HikerLT
1 Replies
3. Programming
Hello all,
i've written a small piece of code that will read commands from standard input and executes the commands.
Its working fine and is execting the commands well. Accepting arguments too. e.g
#mkdir <name of the directory>
The problem is that its not letting me change the directory i.e... (4 Replies)
Discussion started by: Phrozen Smoke
4 Replies
4. UNIX for Dummies Questions & Answers
Can someone help me with an alias...? (1 Reply)
Discussion started by: NetJones
1 Replies
5. Shell Programming and Scripting
I want to log into a remote server transfer over a new config and then backup the existing config, replace with the new config.
I am not sure if I can do this with BASH scripting.
I have set up password less login by adding my public key to authorized_keys file, it works.
I am a little... (1 Reply)
Discussion started by: bash_in_my_head
1 Replies
6. UNIX for Dummies Questions & Answers
Okay so I have an alias that looks like this:
ALIAS gscn {
MSG gscn Test1
MSG gscn Test2
MSG gscn Test3
MSG gscn Test4
MSG gscn Test5
}
How do I make it wait 5 seconds between each command before it executes the next one after that in order from top to bottom? I tried the TIMER... (1 Reply)
Discussion started by: guitarscn
1 Replies
7. UNIX for Dummies Questions & Answers
I have a few aliases set up on AIX servers in my .kshrc file. Some of them contain multiple commands that are piped together.
A simple example would be something like this:
# alias to list directory contents as root and sort by size.
alias lss='sudo ls -l | sort -nbk5'
When I call... (5 Replies)
Discussion started by: derndingle
5 Replies
8. Shell Programming and Scripting
Is there a way to create alias for commands and store then in a location where a certain group can run them. I also want anybody in that group to be able to add alias. I don't want them to access the /etc/environment or /etc/profile files to do so. If there needs to be a line added in either of... (1 Reply)
Discussion started by: daveisme
1 Replies
9. AIX
Hi all,
I'm new in this forum.
I'm looking for the difference between the HACMP commands with the prefix "cl" and "cli".
The first type are under /usr/es/sbin/cluster/sbin directory and the second are under /usr/es/sbin/cluster/cspoc directory.
I know that the first are called HACMP for AIX... (0 Replies)
Discussion started by: peppix
0 Replies
10. UNIX for Dummies Questions & Answers
If one:
$ find -name 'some expression' -type f > newfile
and then subsequently wants to create an alias file from each pathname the find command retrieved and the > placed within 'newfile', how would one do this? Ideally, the newly created alias files would all be in one directory.
I am... (3 Replies)
Discussion started by: Alexander4444
3 Replies
LEARN ABOUT DEBIAN
dbix::class::helper::row::tojson
DBIx::Class::Helper::Row::ToJSON(3pm) User Contributed Perl Documentation DBIx::Class::Helper::Row::ToJSON(3pm)
NAME
DBIx::Class::Helper::Row::ToJSON - Remove the boilerplate from your TO_JSON functions
VERSION
version 2.013002
SYNOPSIS
package MyApp::Schema::Result::KittenRobot;
use base 'DBIx::Class::Core';
__PACKAGE__->load_components(qw{Helper::Row::ToJSON});
__PACKAGE__->table('KittenRobot');
__PACKAGE__->add_columns(
id => {
data_type => 'integer',
is_auto_increment => 1,
},
kitten => {
data_type => 'integer',
},
robot => {
data_type => 'text',
is_nullable => 1,
},
your_mom => {
data_type => 'blob',
is_nullable => 1,
is_serializable => 1,
},
);
1;
This helper adds a JSON method like the following:
sub TO_JSON {
return {
id => $self->id,
kitten => $self->kitten,
# robot => $self->robot, # <-- doesn't serialize text columns
your_mom => $self->your_mom, # <-- normally wouldn't but explicitly
# asked for in the column spec above
}
}
METHODS
_is_column_serializable
$self->_is_column_serializable('kitten')
returns true if a column should be serializable or not. Currently this marks everything as serializable unless "is_serializable" is set to
false, or "data_type" is a "blob", "text", or "ntext" columns. If you wanted to only have explicit serialization you might override this
method to look like this:
sub _is_column_serializable {
my ( $self, $column ) = @_;
my $info = $self->column_info($column);
return defined $info->{is_serializable} && $info->{is_serializable};
}
serializable_columns
$self->serializable_columns
simply returns a list of columns that TO_JSON should serialize.
TO_JSON
$self->TO_JSON
returns a hashref representing your object. Override this method to add data to the returned hashref:
sub TO_JSON {
my $self = shift;
return {
customer_name => $self->customer->name,
%{ $self->next::method },
}
}
AUTHOR
Arthur Axel "fREW" Schmidt <frioux+cpan@gmail.com>
COPYRIGHT AND LICENSE
This software is copyright (c) 2012 by Arthur Axel "fREW" Schmidt.
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-18 DBIx::Class::Helper::Row::ToJSON(3pm)