1 /* unlink - remove a directory entry */
3 /* Should only be used to remove directories by a superuser prepared to let
4 fsck clean up the file system. */
7 Copyright (C) 1999-2009 Free Software Foundation, Inc.
9 This file is part of GNU Bash.
10 Bash is free software: you can redistribute it and/or modify
11 it under the terms of the GNU General Public License as published by
12 the Free Software Foundation, either version 3 of the License, or
13 (at your option) any later version.
15 Bash is distributed in the hope that it will be useful,
16 but WITHOUT ANY WARRANTY; without even the implied warranty of
17 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 GNU General Public License for more details.
20 You should have received a copy of the GNU General Public License
21 along with Bash. If not, see <http://www.gnu.org/licenses/>.
50 if (unlink (list
->word
->word
) != 0)
52 builtin_error ("%s: cannot unlink: %s", list
->word
->word
, strerror (errno
));
53 return (EXECUTION_FAILURE
);
56 return (EXECUTION_SUCCESS
);
59 char *unlink_doc
[] = {
60 "Remove a directory entry.",
62 "Forcibly remove a directory entry, even if it's a directory.",
66 struct builtin unlink_struct
= {
67 "unlink", /* builtin name */
68 unlink_builtin
, /* function implementing the builtin */
69 BUILTIN_ENABLED
, /* initial flags for builtin */
70 unlink_doc
, /* array of long documentation strings. */
71 "unlink name", /* usage synopsis; becomes short_doc */
72 0 /* reserved for internal use */