mirror of
https://https.git.savannah.gnu.org/git/bash.git
synced 2026-08-07 18:52:35 +02:00
Bash-4.3 distribution sources and documentation
This commit is contained in:
+5
-1
@@ -143,7 +143,7 @@
|
||||
</tr>
|
||||
<tr>
|
||||
<td>./functions/keep</td>
|
||||
<td>Try to keep some programs in the forground and running.</td>
|
||||
<td>Try to keep some programs in the foreground and running.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>./functions/ksh-cd</td>
|
||||
@@ -641,6 +641,10 @@
|
||||
<td>Bourne shell cshell-emulator.</td>
|
||||
<td>csh</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>./scripts/bash-hexdump.sh</td>
|
||||
<td>hexdump(1) in bash</td>
|
||||
<td>hexdump -C, hd</td>
|
||||
<tr>
|
||||
<td>./scripts/cat.sh</td>
|
||||
<td>Readline-based pager.</td>
|
||||
|
||||
+2
-1
@@ -32,7 +32,7 @@ Path Description X-Ref
|
||||
./functions/isvalidip Test user input for valid IP Addresses.
|
||||
./functions/jdate.bash Julian date conversion.
|
||||
./functions/jj.bash Look for running jobs.
|
||||
./functions/keep Try to keep some programs in the forground and running.
|
||||
./functions/keep Try to keep some programs in the foreground and running.
|
||||
./functions/ksh-cd ksh-like 'cd': cd [-LP] [dir [change]]. ksh
|
||||
./functions/ksh-compat-test ksh-like arithmetic test replacements. ksh
|
||||
./functions/kshenv Functions and aliases to provide the beginnings of a ksh environment for bash. ksh
|
||||
@@ -151,6 +151,7 @@ Path Description X-Ref
|
||||
|
||||
./scripts Example scripts
|
||||
./scripts/adventure.sh Text adventure game in bash!
|
||||
./scripts/bash-hexdump.sh hexdump(1) in bash
|
||||
./scripts/bcsh.sh Bourne shell cshell-emulator. csh
|
||||
./scripts/cat.sh Readline-based pager. cat, readline pager
|
||||
./scripts/center Center - center a group of lines.
|
||||
|
||||
@@ -0,0 +1,76 @@
|
||||
# cdfunc - example completion function for cd
|
||||
#
|
||||
# based on the cd completion function from the bash_completion package
|
||||
#
|
||||
# Chet Ramey <chet.ramey@case.edu>
|
||||
#
|
||||
# Copyright 2011 Chester Ramey
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2, or (at your option)
|
||||
# any later version.
|
||||
#
|
||||
# TThis program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software Foundation,
|
||||
# Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
|
||||
_comp_cd()
|
||||
{
|
||||
local IFS=$' \t\n' # normalize IFS
|
||||
local cur _skipdot _cdpath
|
||||
local i j k
|
||||
|
||||
# Tilde expansion, with side effect of expanding tilde to full pathname
|
||||
case "$2" in
|
||||
\~*) eval cur="$2" ;;
|
||||
*) cur=$2 ;;
|
||||
esac
|
||||
|
||||
# no cdpath or absolute pathname -- straight directory completion
|
||||
if [[ -z "${CDPATH:-}" ]] || [[ "$cur" == @(./*|../*|/*) ]]; then
|
||||
# compgen prints paths one per line; could also use while loop
|
||||
IFS=$'\n'
|
||||
COMPREPLY=( $(compgen -d -- "$cur") )
|
||||
IFS=$' \t\n'
|
||||
# CDPATH+directories in the current directory if not in CDPATH
|
||||
else
|
||||
IFS=$'\n'
|
||||
_skipdot=false
|
||||
# preprocess CDPATH to convert null directory names to .
|
||||
_cdpath=${CDPATH/#:/.:}
|
||||
_cdpath=${_cdpath//::/:.:}
|
||||
_cdpath=${_cdpath/%:/:.}
|
||||
for i in ${_cdpath//:/$'\n'}; do
|
||||
if [[ $i -ef . ]]; then _skipdot=true; fi
|
||||
k="${#COMPREPLY[@]}"
|
||||
for j in $( compgen -d -- "$i/$cur" ); do
|
||||
COMPREPLY[k++]=${j#$i/} # cut off directory
|
||||
done
|
||||
done
|
||||
$_skipdot || COMPREPLY+=( $(compgen -d -- "$cur") )
|
||||
IFS=$' \t\n'
|
||||
fi
|
||||
|
||||
# variable names if appropriate shell option set and no completions
|
||||
if shopt -q cdable_vars && [[ ${#COMPREPLY[@]} -eq 0 ]]; then
|
||||
COMPREPLY=( $(compgen -v -- "$cur") )
|
||||
fi
|
||||
|
||||
# append slash to passed directory name that is the only completion.
|
||||
# readline will not do this if we complete from CDPATH
|
||||
if [[ ${#COMPREPLY[@]} -eq 1 ]]; then
|
||||
i=${COMPREPLY[0]} # shorthand
|
||||
if [[ "$cur" == "$i" ]] && [[ "$i" != "*/" ]]; then
|
||||
COMPREPLY[0]+=/
|
||||
fi
|
||||
fi
|
||||
return 0
|
||||
}
|
||||
|
||||
complete -o filenames -o nospace -o bashdefault -F _comp_cd cd
|
||||
@@ -1,6 +1,23 @@
|
||||
#
|
||||
# Completion examples
|
||||
#
|
||||
# Chet Ramey <chet.ramey@case.edu>
|
||||
#
|
||||
# Copyright 2002 Chester Ramey
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2, or (at your option)
|
||||
# any later version.
|
||||
#
|
||||
# TThis program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software Foundation,
|
||||
# Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
|
||||
#
|
||||
# This encapsulates the default bash completion code
|
||||
|
||||
@@ -1,3 +1,22 @@
|
||||
#
|
||||
# Chet Ramey <chet.ramey@case.edu>
|
||||
#
|
||||
# Copyright 1999 Chester Ramey
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2, or (at your option)
|
||||
# any later version.
|
||||
#
|
||||
# TThis program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software Foundation,
|
||||
# Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
|
||||
# usage: reverse arrayname
|
||||
reverse()
|
||||
{
|
||||
|
||||
@@ -2,6 +2,24 @@
|
||||
# A function that works as a front end for both stty and the `bind'
|
||||
# builtin, so the tty driver and readline see the same changes
|
||||
#
|
||||
#
|
||||
# Chet Ramey <chet.ramey@case.edu>
|
||||
#
|
||||
# Copyright 2011 Chester Ramey
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2, or (at your option)
|
||||
# any later version.
|
||||
#
|
||||
# TThis program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software Foundation,
|
||||
# Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
|
||||
#
|
||||
# Convert between the stty ^H control character form and the readline \C-H
|
||||
|
||||
+18
-2
@@ -3,8 +3,24 @@
|
||||
#
|
||||
# usage: func name [name ...]
|
||||
#
|
||||
# Chet Ramey
|
||||
# chet@ins.CWRU.Edu
|
||||
# Chet Ramey <chet.ramey@case.edu>
|
||||
#
|
||||
# Copyright 1991 Chester Ramey
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2, or (at your option)
|
||||
# any later version.
|
||||
#
|
||||
# TThis program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software Foundation,
|
||||
# Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
|
||||
func()
|
||||
{
|
||||
local status=0
|
||||
|
||||
@@ -1,3 +1,22 @@
|
||||
#
|
||||
# Chet Ramey <chet.ramey@case.edu>
|
||||
#
|
||||
# Copyright 2002 Chester Ramey
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2, or (at your option)
|
||||
# any later version.
|
||||
#
|
||||
# TThis program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software Foundation,
|
||||
# Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
|
||||
#
|
||||
# inet2hex - Internet address conversion, dotted-decimal to hex
|
||||
#
|
||||
|
||||
@@ -1,3 +1,22 @@
|
||||
#
|
||||
# Chet Ramey <chet.ramey@case.edu>
|
||||
#
|
||||
# Copyright 1998 Chester Ramey
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2, or (at your option)
|
||||
# any later version.
|
||||
#
|
||||
# TThis program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software Foundation,
|
||||
# Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
|
||||
isnum2()
|
||||
{
|
||||
case "$1" in
|
||||
|
||||
@@ -1,3 +1,22 @@
|
||||
#
|
||||
# Chet Ramey <chet.ramey@case.edu>
|
||||
#
|
||||
# Copyright 2001 Chester Ramey
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2, or (at your option)
|
||||
# any later version.
|
||||
#
|
||||
# TThis program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software Foundation,
|
||||
# Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
|
||||
#
|
||||
# ksh-like `cd': cd [-LP] [dir [change]]
|
||||
#
|
||||
|
||||
@@ -1,4 +1,22 @@
|
||||
#
|
||||
# Chet Ramey <chet.ramey@case.edu>
|
||||
#
|
||||
# Copyright 1999 Chester Ramey
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2, or (at your option)
|
||||
# any later version.
|
||||
#
|
||||
# TThis program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software Foundation,
|
||||
# Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
#
|
||||
# replacements for test/[ that do arithmetic expansion on the operands to
|
||||
# the arithmetic operators, like ksh.
|
||||
#
|
||||
|
||||
@@ -5,6 +5,24 @@
|
||||
# Chet Ramey
|
||||
# chet@ins.CWRU.Edu
|
||||
#
|
||||
|
||||
#
|
||||
# Copyright 2002 Chester Ramey
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2, or (at your option)
|
||||
# any later version.
|
||||
#
|
||||
# TThis program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software Foundation,
|
||||
# Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
|
||||
#
|
||||
# These are definitions for the ksh compiled-in `exported aliases'. There
|
||||
# are others, but we already have substitutes for them: "history", "type",
|
||||
|
||||
@@ -1,3 +1,22 @@
|
||||
#
|
||||
# Chet Ramey <chet.ramey@case.edu>
|
||||
#
|
||||
# Copyright 1992 Chester Ramey
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2, or (at your option)
|
||||
# any later version.
|
||||
#
|
||||
# TThis program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software Foundation,
|
||||
# Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
|
||||
trap _notify CHLD
|
||||
NOTIFY_ALL=false
|
||||
unset NOTIFY_LIST
|
||||
|
||||
@@ -1,3 +1,22 @@
|
||||
#
|
||||
# Chet Ramey <chet.ramey@case.edu>
|
||||
#
|
||||
# Copyright 1995 Chester Ramey
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2, or (at your option)
|
||||
# any later version.
|
||||
#
|
||||
# TThis program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software Foundation,
|
||||
# Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
|
||||
# Generate a sequence from m to n, m defaults to 1.
|
||||
|
||||
seq ()
|
||||
|
||||
@@ -1,3 +1,22 @@
|
||||
#
|
||||
# Chet Ramey <chet.ramey@case.edu>
|
||||
#
|
||||
# Copyright 1998 Chester Ramey
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2, or (at your option)
|
||||
# any later version.
|
||||
#
|
||||
# TThis program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software Foundation,
|
||||
# Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
|
||||
# Generate a sequence from m to n, m defaults to 1.
|
||||
|
||||
seq ()
|
||||
|
||||
@@ -1,3 +1,22 @@
|
||||
#
|
||||
# Chet Ramey <chet.ramey@case.edu>
|
||||
#
|
||||
# Copyright 2001 Chester Ramey
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2, or (at your option)
|
||||
# any later version.
|
||||
#
|
||||
# TThis program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software Foundation,
|
||||
# Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
|
||||
# Sort the positional paramters.
|
||||
# Make sure the positional parameters are passed as arguments to the function.
|
||||
# If -u is the first arg, remove duplicate array members.
|
||||
|
||||
@@ -1,4 +1,22 @@
|
||||
#
|
||||
# Chet Ramey <chet.ramey@case.edu>
|
||||
#
|
||||
# Copyright 2002 Chester Ramey
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2, or (at your option)
|
||||
# any later version.
|
||||
#
|
||||
# TThis program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software Foundation,
|
||||
# Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
#
|
||||
# substr -- a function to emulate the ancient ksh builtin
|
||||
#
|
||||
|
||||
|
||||
@@ -1,4 +1,22 @@
|
||||
#
|
||||
# Chet Ramey <chet.ramey@case.edu>
|
||||
#
|
||||
# Copyright 2002 Chester Ramey
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2, or (at your option)
|
||||
# any later version.
|
||||
#
|
||||
# TThis program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software Foundation,
|
||||
# Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
#
|
||||
# substr -- a function to emulate the ancient ksh builtin
|
||||
#
|
||||
|
||||
@@ -29,7 +47,7 @@ substr()
|
||||
done
|
||||
|
||||
if [ "$OPTIND" -gt 1 ] ; then
|
||||
shift $[ $OPTIND -1 ]
|
||||
shift $(( $OPTIND -1 ))
|
||||
fi
|
||||
|
||||
if [ "$#" -eq 0 ] || [ "$#" -gt 2 ] ; then
|
||||
|
||||
@@ -9,6 +9,25 @@
|
||||
# case, the value is printed in a form which would yield the same value
|
||||
# if typed as input to the shell itself.
|
||||
#
|
||||
#
|
||||
# Chet Ramey <chet.ramey@case.edu>
|
||||
#
|
||||
# Copyright 1994 Chester Ramey
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2, or (at your option)
|
||||
# any later version.
|
||||
#
|
||||
# TThis program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software Foundation,
|
||||
# Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
|
||||
|
||||
whatis()
|
||||
{
|
||||
|
||||
@@ -8,6 +8,25 @@
|
||||
# Chet Ramey
|
||||
# chet@ins.CWRU.Edu
|
||||
#
|
||||
#
|
||||
# Chet Ramey <chet.ramey@case.edu>
|
||||
#
|
||||
# Copyright 1994 Chester Ramey
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2, or (at your option)
|
||||
# any later version.
|
||||
#
|
||||
# TThis program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software Foundation,
|
||||
# Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
|
||||
whence()
|
||||
{
|
||||
local vflag= path=
|
||||
|
||||
@@ -3,6 +3,24 @@
|
||||
#
|
||||
# usage: which [-as] command [command...]
|
||||
#
|
||||
#
|
||||
# Chet Ramey <chet.ramey@case.edu>
|
||||
#
|
||||
# Copyright 1999 Chester Ramey
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2, or (at your option)
|
||||
# any later version.
|
||||
#
|
||||
# TThis program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software Foundation,
|
||||
# Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
|
||||
which()
|
||||
{
|
||||
|
||||
@@ -85,7 +85,7 @@ INC = -I. -I.. -I$(topdir) -I$(topdir)/lib -I$(topdir)/builtins \
|
||||
|
||||
ALLPROG = print truefalse sleep pushd finfo logname basename dirname \
|
||||
tty pathchk tee head mkdir rmdir printenv id whoami \
|
||||
uname sync push ln unlink cut realpath getconf strftime mypid
|
||||
uname sync push ln unlink realpath strftime mypid
|
||||
OTHERPROG = necho hello cat
|
||||
|
||||
all: $(SHOBJ_STATUS)
|
||||
@@ -110,9 +110,6 @@ print: print.o
|
||||
necho: necho.o
|
||||
$(SHOBJ_LD) $(SHOBJ_LDFLAGS) $(SHOBJ_XLDFLAGS) -o $@ necho.o $(SHOBJ_LIBS)
|
||||
|
||||
getconf: getconf.o
|
||||
$(SHOBJ_LD) $(SHOBJ_LDFLAGS) $(SHOBJ_XLDFLAGS) -o $@ getconf.o $(SHOBJ_LIBS)
|
||||
|
||||
hello: hello.o
|
||||
$(SHOBJ_LD) $(SHOBJ_LDFLAGS) $(SHOBJ_XLDFLAGS) -o $@ hello.o $(SHOBJ_LIBS)
|
||||
|
||||
@@ -179,9 +176,6 @@ ln: ln.o
|
||||
unlink: unlink.o
|
||||
$(SHOBJ_LD) $(SHOBJ_LDFLAGS) $(SHOBJ_XLDFLAGS) -o $@ unlink.o $(SHOBJ_LIBS)
|
||||
|
||||
cut: cut.o
|
||||
$(SHOBJ_LD) $(SHOBJ_LDFLAGS) $(SHOBJ_XLDFLAGS) -o $@ cut.o $(SHOBJ_LIBS)
|
||||
|
||||
realpath: realpath.o
|
||||
$(SHOBJ_LD) $(SHOBJ_LDFLAGS) $(SHOBJ_XLDFLAGS) -o $@ realpath.o $(SHOBJ_LIBS)
|
||||
|
||||
@@ -229,7 +223,6 @@ tee.o: tee.c
|
||||
head.o: head.c
|
||||
rmdir.o: rmdir.c
|
||||
necho.o: necho.c
|
||||
getconf.o: getconf.c
|
||||
hello.o: hello.c
|
||||
cat.o: cat.c
|
||||
printenv.o: printenv.c
|
||||
|
||||
@@ -2,6 +2,24 @@
|
||||
|
||||
/* See Makefile for compilation details. */
|
||||
|
||||
/*
|
||||
Copyright (C) 1999-2009 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of GNU Bash.
|
||||
Bash is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
Bash is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with Bash. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#if defined (HAVE_UNISTD_H)
|
||||
|
||||
@@ -5,6 +5,24 @@
|
||||
* chet@po.cwru.edu
|
||||
*/
|
||||
|
||||
/*
|
||||
Copyright (C) 1999-2009 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of GNU Bash.
|
||||
Bash is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
Bash is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with Bash. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
#endif
|
||||
|
||||
@@ -3,6 +3,24 @@
|
||||
|
||||
/* See Makefile for compilation details. */
|
||||
|
||||
/*
|
||||
Copyright (C) 1999-2009 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of GNU Bash.
|
||||
Bash is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
Bash is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with Bash. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include <config.h>
|
||||
|
||||
#if defined (HAVE_UNISTD_H)
|
||||
|
||||
@@ -109,7 +109,7 @@ mkdir_builtin (list)
|
||||
umask (original_umask);
|
||||
|
||||
nmode = (S_IRWXU | S_IRWXG | S_IRWXO) & ~original_umask;
|
||||
parent_mode = nmode | (S_IWRITE|S_IEXEC); /* u+wx */
|
||||
parent_mode = nmode | (S_IWUSR|S_IXUSR); /* u+wx */
|
||||
|
||||
/* Adjust new mode based on mode argument */
|
||||
nmode &= omode;
|
||||
|
||||
@@ -66,6 +66,10 @@ WORD_LIST *list;
|
||||
return(EX_USAGE);
|
||||
}
|
||||
|
||||
/* Skip over `--' */
|
||||
if (list->word && ISOPTION (list->word->word, '-'))
|
||||
list = list->next;
|
||||
|
||||
if (*list->word->word == '-' || list->next) {
|
||||
builtin_usage ();
|
||||
return (EX_USAGE);
|
||||
|
||||
@@ -5,6 +5,23 @@
|
||||
# tabs in the lines might cause this to look a little bit off
|
||||
#
|
||||
#
|
||||
# Chet Ramey <chet.ramey@case.edu>
|
||||
#
|
||||
# Copyright 1999 Chester Ramey
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2, or (at your option)
|
||||
# any later version.
|
||||
#
|
||||
# TThis program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software Foundation,
|
||||
# Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
|
||||
width=${COLUMNS:-80}
|
||||
|
||||
|
||||
@@ -11,6 +11,22 @@
|
||||
#
|
||||
# Chet Ramey
|
||||
# chet@ins.CWRU.Edu
|
||||
#
|
||||
# Copyright 2002 Chester Ramey
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2, or (at your option)
|
||||
# any later version.
|
||||
#
|
||||
# TThis program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software Foundation,
|
||||
# Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
|
||||
type=file
|
||||
|
||||
@@ -44,7 +60,7 @@ do
|
||||
done
|
||||
|
||||
if [ "$OPTIND" -gt 1 ] ; then
|
||||
shift $[$OPTIND - 1]
|
||||
shift $(( $OPTIND - 1 ))
|
||||
fi
|
||||
|
||||
while :
|
||||
|
||||
@@ -5,6 +5,22 @@
|
||||
# Chet Ramey
|
||||
# chet@po.cwru.edu
|
||||
#
|
||||
# Copyright 1997 Chester Ramey
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2, or (at your option)
|
||||
# any later version.
|
||||
#
|
||||
# TThis program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software Foundation,
|
||||
# Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
|
||||
bs=$'\b'
|
||||
|
||||
chars="|${bs} \\${bs} -${bs} /${bs}"
|
||||
|
||||
@@ -4,6 +4,23 @@
|
||||
#
|
||||
# Derived from http://www.clark.net/pub/dickey/xterm/xterm.faq.html#how2_title
|
||||
#
|
||||
|
||||
# Copyright 1997 Chester Ramey
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2, or (at your option)
|
||||
# any later version.
|
||||
#
|
||||
# TThis program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software Foundation,
|
||||
# Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
|
||||
P=${0##*/}
|
||||
[ -z "$DISPLAY" ] && {
|
||||
echo "${P}: not running X" >&2
|
||||
|
||||
@@ -11,6 +11,23 @@
|
||||
# Chet Ramey
|
||||
# chet@po.cwru.edu
|
||||
|
||||
# Copyright 1996 Chester Ramey
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2, or (at your option)
|
||||
# any later version.
|
||||
#
|
||||
# TThis program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software Foundation,
|
||||
# Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
|
||||
|
||||
[ $# -lt 1 ] && {
|
||||
echo "zprintf: usage: zprintf format [args ...]" >&2
|
||||
exit 2
|
||||
|
||||
@@ -10,12 +10,3 @@ bash-profile Sample startup file for bash login shells (Ramey).
|
||||
bashrc Sample Bourne Again SHell init file (Ramey).
|
||||
Bashrc.bfox Sample Bourne Again SHell init file (Fox).
|
||||
README README
|
||||
|
||||
apple Example Start-up files for Mac OS X.
|
||||
apple/aliases Sample aliases for Mac OS X.
|
||||
apple/bash.defaults Sample User preferences file.
|
||||
apple/environment Sample Bourne Again Shell environment file.
|
||||
apple/login Sample login wrapper.
|
||||
apple/logout Sample logout wrapper.
|
||||
apple/rc Sample Bourne Again Shell config file.
|
||||
apple/README README
|
||||
|
||||
Reference in New Issue
Block a user