Why is my program called "set" not being executed?
10
votes
4
answers
1274
views
I've created a simple C program like so:
int main(int argc, char *argv[]) {
if (argc != 5) {
fputs("Not enough arguments!\n", stderr);
exit(EXIT_FAILURE);
}
And I have my PATH modified in *etc/bash.bashrc* like so:
PATH=.:$PATH
I've saved this program as set.c and am compiling it with
gcc -o set set.c
in the folder
~/Programming/so
However, when I call
set 2 3
nothing happens. There is no text that appears.
Calling
./set 2 3
gives the expected result
I've never had a problem with PATH before and
which set
returns
./set
. So it seems the PATH is the correct one. What's is happening?
Asked by Ganea Dan Andrei
(203 rep)
Nov 24, 2015, 02:36 PM
Last activity: Dec 6, 2023, 03:00 PM
Last activity: Dec 6, 2023, 03:00 PM