Sign in to follow this  
Followers 0
Elimist

Weird gnuls error

13 posts in this topic

Well, I was removing a package on my slackware system earlier, planning on upgrading it manually. I run removepkg, then yet:

ls: unrecognized option `---1'

Try `ls --help' for more information.

So I fire up verbosity (/bin/sh -v) on the script to see why something is calling /bin/ls --1...

Removing package /var/log/packages/mysql-4.0.15a-i486-1...

Removing files:

ls * | sed "/^$2$/d"

ls: unrecognized option `---1'

Try `ls --help' for more information.

Now, since * will return all the files in the current working directory, you'd assume it was finding a file called ---1, which isn't possible on POSIX systems. Anyone have any suggestions as to whats up?

0

Share this post


Link to post
Share on other sites

[rijilv@eol:rijilv] $ touch "\--1"

[rijilv@eol:rijilv] $ ls -l "\--1"

-rw-r--r-- 1 rijilv rijilv 0 May 16 23:23 \--1

[rijilv@eol:rijilv] $ rm "\--1"

no possible eh? I guess

rijilv@eol:rijilv] $ uname -a

Linux eol.nexus 2.6.5-gentoo-r1 #5 Sun May 16 16:44:19 PDT 2004 i686 AMD Athlon XP 1900+ AuthenticAMD GNU/Linux

must not be posix...

0

Share this post


Link to post
Share on other sites
[rijilv@eol:rijilv] $ touch "\--1"

[rijilv@eol:rijilv] $ ls -l "\--1"

-rw-r--r-- 1 rijilv rijilv 0 May 16 23:23 \--1

[rijilv@eol:rijilv] $ rm "\--1"

no possible eh? I guess

rijilv@eol:rijilv] $ uname -a

Linux eol.nexus 2.6.5-gentoo-r1 #5 Sun May 16 16:44:19 PDT 2004 i686 AMD Athlon XP 1900+ AuthenticAMD GNU/Linux

must not be posix...

Note that \--1 != --1.

elimist@revolution:~$ touch "--1"

touch: unrecognized option `--1'

Try `touch --help' for more information.

elimist@revolution:~$ ls -l "--1"

/usr/bin/ls: unrecognized option `--1'

Try `/usr/bin/ls --help' for more information.

elimist@revolution:~$ rm "--1"

rm: unrecognized option `--1'

Try `rm --help' for more information.

I have no idea if you could create --1 with low level system calls like fopen. I heavily doubt it. Even if you could, it'd be something you'd pretty much have to do purposely.

0

Share this post


Link to post
Share on other sites
#include <stdio.h>

int main(int argc, char *argv[]){        FILE *fp=fopen("---1", "w");        fputs("m00", fp);        fclose(fp);

       system("ls");

       remove("---1");

       printf("----------\n");

       system("ls");

       exit(0);}

lattera@revolution:~$ ./test---1   chmod.txt  lsex    main.c  output  random.c  rc4.h  test.ca.out  input      lsex.c  outdec  random  rc4       test----------a.out      input  lsex.c  outdec  random    rc4    testchmod.txt  lsex   main.c  output  random.c  rc4.h  test.c
0

Share this post


Link to post
Share on other sites

I had a similar problem, some goober named a wallpaper -Frostbyte- and when I would ls * or ls *.jpg it would come back with an error...I forget how I fixed it, I think a simple mv

0

Share this post


Link to post
Share on other sites

Yeah, FreeNet proved me wrong this morning..it is *possible* to have a file named --1.....but I don't HAVE a file named --1 anywhere on my system.....anyway, someone would have to want to fuck with you, making a file named --1 because its (as we've seen) impossible to use wiht most CLI tools.

Anyway, I don't think its a case of (for some strange reason) their beign a file named --1. I think something strange is going on.

0

Share this post


Link to post
Share on other sites
[Note that \--1 != --1.

elimist@revolution:~$ touch "--1"

touch: unrecognized option `--1'

Try `touch --help' for more information.

elimist@revolution:~$ ls -l "--1"

/usr/bin/ls: unrecognized option `--1'

Try `/usr/bin/ls --help' for more information.

elimist@revolution:~$ rm "--1"

rm: unrecognized option `--1'

Try `rm --help' for more information.

I have no idea if you could create --1 with low level system calls like fopen. I heavily doubt it. Even if you could, it'd be something you'd pretty  much have to do purposely."

ok

[rijilv@eol.rijilv]$ touch -- --1

[rijilv@eol:rijilv] $ ls -l -- --1

-rw-r--r-- 1 rijilv rijilv 0 May 17 18:13 --1

[rijilv@eol:rijilv] $ rm -- --1

[rijilv@eol:rijilv] $ man ls

[....]

GNU STANDARD OPTIONS

[...]

-- Terminate option list.

[...]

you see, when you ls the file name --1 or *, ls thinks you are giving it an option. use the "--" option, clearly defined in the man page under the heading "GNU STANDARD OPTIONS" to avoid this behavior.

0

Share this post


Link to post
Share on other sites

I know that. I've understood that fromt he start, that gnuls things its being fed a command line option. However, the fact remains that I HAVE NO FILE NAMED --1 ON MY HARD DRIVE.

0

Share this post


Link to post
Share on other sites

try doing a /bin/ls

perhaps there has arisen a problem with your ls alias or dircolors or something

0

Share this post


Link to post
Share on other sites

/usr/bin/ls is symlinked to /bin/ls

0

Share this post


Link to post
Share on other sites

first thing I'd do if you suspect something strange is happening is to check your logs, and the logs of all your services. In regards to the package not being able to remove properly, have you tried the upgradepkg tool, or worse comes to worse you can just manually remove it, and then recompile and make install. I've had relativly good luck with slackpacks but some of them have either not installed properly, or failed to be remove cleanly, albiet never with the same error your having. Hope that helps, and if not, if you can post a link where you got the orrigonal package I can try it on my slack box and see if it exhibits the same behavior.

cheers

lumi

0

Share this post


Link to post
Share on other sites

Looks like Elimist did have a file named ---1 on his system...

0

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0