Save time at the command line with shell aliases and functions


 
Thread Tools Search this Thread
Special Forums News, Links, Events and Announcements UNIX and Linux RSS News Save time at the command line with shell aliases and functions
# 1  
Old 09-16-2008
Save time at the command line with shell aliases and functions

09-16-2008 01:00 AM
Familiarity with command prompts and shell scripts is still necessary if you want to get the most from your GNU/Linux system, but the less time you spend doing that the better, right? Two powerful ways to minimize your time at the command line are shell aliases and functions.



Source...
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Are aliases available in shell scripts?

I define aliases and save in rc file. what I see is that it isn't available in shell scripts. They are however available in interpretive or interactive sub-shell which I get when I give command bash For ex.: I define alias echo='echo -n' it's unavailable in shell scripts but sub-shells. (5 Replies)
Discussion started by: ravisingh
5 Replies

2. Shell Programming and Scripting

How to execute functions or initiate functions as command line parameters for below requirement?

I have 7 functions those need to be executed as command line inputs, I tried with below code it’s not executing function. If I run the ./script 2 then fun2 should execute , how to initiate that function I tried case and if else also, how to initiate function from command line if then... (8 Replies)
Discussion started by: saku
8 Replies

3. Shell Programming and Scripting

"Time" command and save result in a file.txt

Hi, I'am using "time" to check execution time of some script. Is there any possibility to save time command result into a file ? (2 Replies)
Discussion started by: Physix
2 Replies

4. Shell Programming and Scripting

execution of aliases from shell script

Hi I have to execute the commands in .aliases file from a shell script I tried 1.giving the alias directly in shell script 2.Giving the actually "value of alias" in the shell script 3. I tried giving both steps 1 and 2 inside ` quotes Still nothing is working . It says command... (3 Replies)
Discussion started by: ssuresh1999
3 Replies

5. Shell Programming and Scripting

How to get the time cost of functions?

hi, There is a shell including many functions, when I run ksh -x/-v to see the call sequence, but how do I know which function cost more? Of course, use time CMD to get the scripts runnning time, while it can not tell me which cost more. Thanks very much. (1 Reply)
Discussion started by: a2156z
1 Replies

6. Shell Programming and Scripting

Accessing aliases within a shell script

I am not able to access the aliases in my environment within a Python script. If I pass the alias to os.system(), I get a message saying "sh: x: not found". I've tried sourcing my .bashrc file in the script, but this does not work. I would perfer not to source my or any rc file because this... (9 Replies)
Discussion started by: cooldude
9 Replies

7. Solaris

create command aliases for a user

Hi all, I am using Solaris 10 OS on X86. When I add a new user from command useradd -d /export/home/vikas -m -s /bin/bash vikas files local.cshrc, local.login, local.profile and .profile get copied to my home directory (i.e. /export/home/vikas) from /etc/skel/ Which file I have to change... (4 Replies)
Discussion started by: vikas027
4 Replies

8. Shell Programming and Scripting

Time out in shell script for a stament/line

Folks, In shell script, can I mention a timeout for a command execution, afterwhich I want to exit from that particular line and proceed furthur. I have part of my script as below: ****************************** cd $EXPECT_HOME expect custom_install.exp mv... (5 Replies)
Discussion started by: gvsreddy_539
5 Replies

9. Shell Programming and Scripting

passing command line parameters to functions - sh

All, I have a sh script of the following tune: function a () { #functionality.. } function b () { #functionnlity.. } function check () { # this function checks for env and if all fine call build } function usage () { #sh usage details } function build () { #calls either a or b or... (5 Replies)
Discussion started by: vino
5 Replies

10. Programming

time functions help?

Hello to anyone who can help me! I am in need of some help in procuring a more exact timing scheme in C for use with gcc. I manage to get a timing in seconds just fine using difftime(). However, I need more accurate.. milliseconds... no clue. Please help? Brian (2 Replies)
Discussion started by: bcowan
2 Replies
Login or Register to Ask a Question
shell(1F)							   FMLI Commands							 shell(1F)

NAME
shell - run a command using shell SYNOPSIS
shell command [command] ... DESCRIPTION
The shell function concatenate its arguments, separating each by a space, and passes this string to the shell ($SHELL if set, otherwise /usr/bin/sh). EXAMPLES
Example 1: A sample output of shell command. Since the Form and Menu Language does not directly support background processing, the shell function can be used instead. `shell "build prog > /dev/null &"` If you want the user to continue to be able to interact with the application while the background job is running, the output of an exe- cutable run by shell in the background must be redirected: to a file if you want to save the output, or to /dev/null if you don't want to save it (or if there is no output), otherwise your application may appear to be hung until the background job finishes processing. shell can also be used to execute a command that has the same name as an FMLI built-in function. NOTES
The arguments to shell will be concatenate using spaces, which may or may not do what is expected. The variables set in local environments will not be expanded by the shell because "local" means "local to the current process." ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Availability |SUNWcsu | +-----------------------------+-----------------------------+ SEE ALSO
sh(1), attributes(5) SunOS 5.10 5 Jul 1990 shell(1F)