TIMEOUT

2009-04-04 Thread Sergio Charpinel Jr.
Hi,
I'm in this mailing list, and I dont know if I am in the right place. If it
doesnt, tell me.
So, first of all, I'm trying to find a way to combine TMOUT variable with
vlock. I just found a way to do this in zhs. And if it is not possible, I
need to set TIMEOUT just for root, and it can't logout when root is using
screen.
I tried to do something, but I'm new in bash. My "script" didnt work.

for f in $( ps ax ); do
if [ $f == "SCREEN" ]; then
export TMOUT=0
fi
done

Help??
Thanks
-- 
Sergio Roberto Charpinel Jr.


Re: TIMEOUT

2009-04-04 Thread Allodoxaphobia
On Sat, 4 Apr 2009 08:37:32 -0300, Sergio Charpinel Jr. wrote:
> Hi,
> I'm in this mailing list, and I dont know if I am in the right place. If it
> doesnt, tell me.

  comp.unix.shell

I know, it's not very intuitive...
Jonesy
-- 
  Marvin L Jones| jonz  | W3DHJ  | linux
   38.24N  104.55W  |  @ config.com | Jonesy |  OS/2
* Killfiling google & banter.com: jonz.net/ng.htm




Re: Question

2009-04-04 Thread Spamm Trappe
On Thu, 2 Apr 2009 18:33:40 -0700, Brandon F wrote:
> When I do traceroute in bash I am always getting
> 12-215-11-193.client.mchsi.com as the third or fourth site. I want to know
> how to clear this from my route list. So it will bounce off of a differant
> site. Thank you.

What a _clever_ Subject: !!




Brace expansion

2009-04-04 Thread Ray Parrish

Hello,

I'm attempting to study Brace Expansion at the same named page at 
bash-hackers.org and it states the following -

Generate numbers with a prefix 001 002 ...

Using a prefix:

for i in 0{1..9} 10; do printf "%d\n" "$i";done

However I am getting *this* output when running their command in 
Terminal In Ubuntu 8.04


r...@ray-desktop:~$ for i in 0{1..9} 10; do printf "%d\n" "$i";done
1
2
3
4
5
6
7
bash: printf: 08: invalid number
0
bash: printf: 09: invalid number
0
10

So... what gives??? I tried looking at info coreutils 'printf 
invocation', and it does not even explicitly spell out what the %d 
argument means, instead it just tells me "it's like the C printf, except 
for these differences". I have never used C, and have no idea where to 
look it up, so what good is that info page??? I'm trying to learn bash, 
and have no desire to learn to program in C.


Later, Ray Parrish

--
Human reviewed index of links about the computer
http://www.rayslinks.com
Poetry from the mind of a Schizophrenic
http://www.writingsoftheschizophrenic.com/





Re: Brace expansion

2009-04-04 Thread Chris F.A. Johnson

On Sat, 4 Apr 2009, Ray Parrish wrote:

I'm attempting to study Brace Expansion at the same named page at 
bash-hackers.org and it states the following -

Generate numbers with a prefix 001 002 ...

Using a prefix:

for i in 0{1..9} 10; do printf "%d\n" "$i";done

However I am getting *this* output when running their command in Terminal In 
Ubuntu 8.04


r...@ray-desktop:~$ for i in 0{1..9} 10; do printf "%d\n" "$i";done
1
2
3
4
5
6
7
bash: printf: 08: invalid number
0
bash: printf: 09: invalid number
0
10

So... what gives???


Numbers beginnig with 0 are required to be interpreted as octal
numbers. 08 and 08 ar enot valid octal numbers.

for i in 0{1..9} 10; do printf "%02d\n" "$[i#0}";done

 Or:

printf "%02d\n" {1..10}

Or, in bash4.0:

printf "%s\n" {01..10}


--
   Chris F.A. Johnson, webmaster 
   = Do not reply to the From: address; use Reply-To: 
   Author:
   Shell Scripting Recipes: A Problem-Solution Approach (2005, Apress)