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 1, or (at your option) any later
+Software Foundation; either version 2, or (at your option) any later
version.
Bash is distributed in the hope that it will be useful, but WITHOUT ANY
You should have received a copy of the GNU General Public License along
with Bash; see the file COPYING. If not, write to the Free Software
-Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
+Foundation, 59 Temple Place, Suite 330, Boston, MA 02111 USA.
$BUILTIN alias
$FUNCTION alias_builtin
#if defined (ALIAS)
#if defined (HAVE_UNISTD_H)
+# ifdef _MINIX
+# include <sys/types.h>
+# endif
# include <unistd.h>
#endif
# include "common.h"
# include "bashgetopt.h"
-extern int interactive;
-static void print_alias ();
+static void print_alias __P((alias_t *));
/* Hack the alias command in a Korn shell way. */
int
if (list == 0 || pflag)
{
if (aliases == 0)
- return (EXECUTION_FAILURE);
+ return (EXECUTION_SUCCESS);
alias_list = all_aliases ();
if (alias_list == 0)
- return (EXECUTION_FAILURE);
+ return (EXECUTION_SUCCESS);
for (offset = 0; alias_list[offset]; offset++)
print_alias (alias_list[offset]);
print_alias (t);
else
{
- if (interactive)
- builtin_error ("`%s' not found", name);
+ builtin_error ("`%s' not found", name);
any_failed++;
}
}
remove_alias (alias->name);
else
{
- if (interactive)
- builtin_error ("`%s': not an alias", list->word->word);
-
+ builtin_error ("`%s': not an alias", list->word->word);
aflag++;
}
{
char *value;
- value = single_quote (alias->value);
+ value = sh_single_quote (alias->value);
printf ("alias %s=%s\n", alias->name, value);
free (value);