~ubuntu-branches/ubuntu/trusty/bash/trusty-security

« back to all changes in this revision

Viewing changes to .pc/bash-aliases-repeat.diff/examples/startup-files/Bash_aliases

  • Committer: Package Import Robot
  • Author(s): Matthias Klose
  • Date: 2014-03-03 22:52:05 UTC
  • mfrom: (1.3.5) (2.2.6 experimental)
  • Revision ID: package-import@ubuntu.com-20140303225205-87ltrt5kspeq0g1b
Tags: 4.3-1ubuntu1
* Merge with Debian; remaining changes:
  - skel.bashrc:
    - Run lesspipe.
    - Enable ls aliases.
    - Set options in ll alias to -alF.
    - Define an alert alias.
    - Enabled colored grep aliases.
  - etc.bash.bashrc:
    - Add sudo hint.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# Some useful aliases.
 
2
alias texclean='rm -f *.toc *.aux *.log *.cp *.fn *.tp *.vr *.pg *.ky'
 
3
alias clean='echo -n "Really clean this directory?";
 
4
        read yorn;
 
5
        if test "$yorn" = "y"; then
 
6
           rm -f \#* *~ .*~ *.bak .*.bak  *.tmp .*.tmp core a.out;
 
7
           echo "Cleaned.";
 
8
        else
 
9
           echo "Not cleaned.";
 
10
        fi'
 
11
alias h='history'
 
12
alias j="jobs -l"
 
13
alias l="ls -l "
 
14
alias ll="ls -l"
 
15
alias ls="ls -F"
 
16
alias pu="pushd"
 
17
alias po="popd"
 
18
 
 
19
#
 
20
# Csh compatability:
 
21
#
 
22
alias unsetenv=unset
 
23
function setenv () {
 
24
  export $1="$2"
 
25
}
 
26
 
 
27
# Function which adds an alias to the current shell and to
 
28
# the ~/.bash_aliases file.
 
29
add-alias ()
 
30
{
 
31
   local name=$1 value="$2"
 
32
   echo alias $name=\'$value\' >>~/.bash_aliases
 
33
   eval alias $name=\'$value\'
 
34
   alias $name
 
35
}
 
36
 
 
37
# "repeat" command.  Like:
 
38
#
 
39
#       repeat 10 echo foo
 
40
repeat ()
 
41
 
42
    local count="$1" i;
 
43
    shift;
 
44
    for i in $(seq 1 "$count");
 
45
    do
 
46
        eval "$@";
 
47
    done
 
48
}
 
49
 
 
50
# Subfunction needed by `repeat'.
 
51
seq ()
 
52
 
53
    local lower upper output;
 
54
    lower=$1 upper=$2;
 
55
 
 
56
    if [ $lower -ge $upper ]; then return; fi
 
57
    while [ $lower -le $upper ];
 
58
    do
 
59
        echo -n "$lower "
 
60
        lower=$(($lower + 1))
 
61
    done
 
62
    echo "$lower"
 
63
}