Mailinglist Archive: opensuse (4570 mails)
| < Previous | Next > |
Re: [SLE] ls funny issue <SOLVED>
- From: Chadley Wilson <chadley@xxxxxxxxxxxx>
- Date: Thu, 24 Nov 2005 10:14:51 +0000 (UTC)
- Message-id: <1132827294.6323.27.camel@xxxxxxxxxxxxxxxxxxxxxx>
On Thu, 2005-11-24 at 09:13 +0000, Fergus Wilde wrote:
> On Thursday 24 November 2005 08:23, Chadley Wilson wrote:
> > Greetings,
> >
> > Been struggling for a while trying to figure out why my script keeps
> > removing the hidden directories:
> >
> > When you run ls -l as a user you get a listing without the .xxxxx files,
> > But as root ls -l shows all anyway.
> >
> > So when root runs the script it deletes everything in the folder.
> >
> > I assumed there was an alias runnng for ls but can't find it.
> >
> > Can someone here please assist
> >
> > Thanks
> > Chadley
>
> Now I look, the 'env' for a default user shows this variable set:
>
> LS_OPTIONS=-N --color=tty -T 0
>
> Whereas for root, 'env' shows:
>
> LS_OPTIONS=-a -N --color=tty -T 0
>
> So the 'ls -a' for root is coming from there. I'm just casting about trying to
> find out where that variable is set - first person to send a link to a
> thorough discussion of SuSE's bash variables gets a lollipop.
>
> But you could perhaps put something in your script that unsets that part of
> the variable.
>
> export LS_OPTIONS=
^^^^^^^^^^^^^^^^^^^^
Thanks,
This does the trick....
>
> zeroes it out and stops the ls -a behaviour for the remainder of the session.
>
> Should your script be in bash? It used, at least, to be practice to run a lot
> of shells as sh, and indeed if you change to sh you'll notice ls doesn't list
> dotfiles.
>
> How about having a go with your script with sh as the shell? IIRC putting
>
> #!/bin/sh
>
> at the top of the file should do it.
>
> HTH
> Fergus
>
>
>
> On Thursday 24 November 2005 08:23, Chadley Wilson wrote:
> > Greetings,
> >
> > Been struggling for a while trying to figure out why my script keeps
> > removing the hidden directories:
> >
> > When you run ls -l as a user you get a listing without the .xxxxx files,
> > But as root ls -l shows all anyway.
> >
> > So when root runs the script it deletes everything in the folder.
> >
> > I assumed there was an alias runnng for ls but can't find it.
> >
> > Can someone here please assist
> >
> > Thanks
> > Chadley
>
> Now I look, the 'env' for a default user shows this variable set:
>
> LS_OPTIONS=-N --color=tty -T 0
>
> Whereas for root, 'env' shows:
>
> LS_OPTIONS=-a -N --color=tty -T 0
>
> So the 'ls -a' for root is coming from there. I'm just casting about trying to
> find out where that variable is set - first person to send a link to a
> thorough discussion of SuSE's bash variables gets a lollipop.
>
> But you could perhaps put something in your script that unsets that part of
> the variable.
>
> export LS_OPTIONS=
^^^^^^^^^^^^^^^^^^^^
Thanks,
This does the trick....
>
> zeroes it out and stops the ls -a behaviour for the remainder of the session.
>
> Should your script be in bash? It used, at least, to be practice to run a lot
> of shells as sh, and indeed if you change to sh you'll notice ls doesn't list
> dotfiles.
>
> How about having a go with your script with sh as the shell? IIRC putting
>
> #!/bin/sh
>
> at the top of the file should do it.
>
> HTH
> Fergus
>
>
>
| < Previous | Next > |