Re: [gentoo-user] OT: bash scripting: implement uninterruptable sleep

2006-03-31 Thread Sascha Lucas
Hi, On Tue, 28 Mar 2006, Richard Fish wrote: On 3/28/06, Sascha Lucas <[EMAIL PROTECTED]> wrote: I have a shell script and want a uninterruptable sleep. /usr/bin/sleep itself seems to have its own signal handlers. How is it possible to sleep uninterruptable? trap "echo 'Ctrl+C should not wor

Re: [gentoo-user] OT: bash scripting: implement uninterruptable sleep

2006-03-28 Thread Richard Fish
On 3/28/06, Sascha Lucas <[EMAIL PROTECTED]> wrote: > Hi List, > > I have a shell script and want a uninterruptable sleep. /usr/bin/sleep > itself seems to have its own signal handlers. How is it possible to sleep > uninterruptable? trap "echo 'Ctrl+C should not work'" INT now=`date +%s` expires=$

[gentoo-user] OT: bash scripting: implement uninterruptable sleep

2006-03-28 Thread Sascha Lucas
Hi List, I have a shell script and want a uninterruptable sleep. /usr/bin/sleep itself seems to have its own signal handlers. How is it possible to sleep uninterruptable? #!/bin/bash trap "echo 'Ctrl+C should not work'" INT for foo in 1 2 3; do echo $foo sleep 10 done ## end

Re: [gentoo-user] OT: bash scripting help requested. Quoting?

2006-03-22 Thread Neil Bothwick
On Wed, 22 Mar 2006 06:47:35 +, Stroller wrote: > I would like to automate the above process by writing a bash script > which will take all the possible find terms and amalgamate them; it > should allow some flexibility, interaction and for me to edit the > terms easily. Why not use rsy

Re: [gentoo-user] OT: bash scripting help requested. Quoting?

2006-03-21 Thread Iain Buchanan
On Wed, 2006-03-22 at 06:47 +, Stroller wrote: > I'm afraid quoting really is my Achilles' proverbial in Bash I don't think you're alone there :) how about: #!/bin/bash UNNEEDED_FILES=(pagefile.sys temp 'Temporary Internet Files') for (( i=0 ; $i < ${#UNNEEDED_FILES[*]} ; i++ )) ; do echo

[gentoo-user] OT: bash scripting help requested. Quoting?

2006-03-21 Thread Stroller
In the course of my job as a computer-fixer I am often asked to back up files from PCs on which Windows has crashed. In order to ensure that I get every file on the system (both c:\dave and "c:\Documents and Settings\Dave\Local Settings\Application Data \obscure\path\to\important\set\of\mail

Re: [gentoo-user] [OT] Bash scripting 2

2005-11-11 Thread Alexander Skwar
Peper schrieb: > Hello, > How can i check whether i can create or overwrite a file? You need write access on the directory for creating files and on the file for overwriting. > For example: > If /etc/conf.d/net cannot be overwritten or created it return false. Use "test" or "[" or "[[". > Overw

Re: [gentoo-user] [OT] Bash scripting 2

2005-11-11 Thread Renat Golubchyk
On Fri, 11 Nov 2005 18:57:40 +0100 Peper <[EMAIL PROTECTED]> wrote: > Hello, > How can i check whether i can create or overwrite a file? > > For example: > If /etc/conf.d/net cannot be overwritten or created it return false. > > Overwriting test would be -w /etc/conf.d/net, but how can i check if

Re: [gentoo-user] [OT] Bash scripting 2

2005-11-11 Thread Peter De Zutter
Hi, you can check if the directory containing the file is writable, if it isn't then you can't create a file. Greetz Peter On 11/11/05, Peper <[EMAIL PROTECTED]> wrote: Hello,How can i check whether i can create or overwrite a file?For example:If /etc/conf.d/net cannot be overwritten or created it

[gentoo-user] [OT] Bash scripting 2

2005-11-11 Thread Peper
Hello, How can i check whether i can create or overwrite a file? For example: If /etc/conf.d/net cannot be overwritten or created it return false. Overwriting test would be -w /etc/conf.d/net, but how can i check if i can create this file? I could check whether i can create new files in /etc/co

Re: [gentoo-user] [OT] Bash scripting

2005-11-11 Thread Matthias Guede
Peper wrote: Hello, I have a var $blah=' `pwd`/blah ' (extra spaces for clearer reading), how can i change it to 'output of pwd/blah' ? I'm not quiet sure what you mean with "output of pwd/blah". If you want to assign "/home/me/blah" (or whatever your current directory is) you may use the en

Re: [gentoo-user] [OT] Bash scripting

2005-11-11 Thread Allan Spagnol Comar
#!/bin/sh # blah=`pwd`/blah echo $blah output: /home/thor/tmp/blah holpe it helps. On 11/11/05, Peper <[EMAIL PROTECTED]> wrote: > Hello, > I have a var $blah=' `pwd`/blah ' (extra spaces for clearer reading), how can > i change it to 'output of pwd/blah' ? > > -- > Best Regards, > Peper > --

Re: [gentoo-user] [OT] Bash scripting

2005-11-11 Thread Stoian Ivanov
On Friday 11 November 2005 15:56, Peper wrote: > Hello, > I have a var $blah=' `pwd`/blah ' (extra spaces for clearer reading), how > can i change it to 'output of pwd/blah' ? > > -- > Best Regards, > Peper [EMAIL PROTECTED] ~ $ echo "`pwd`/blah" /home/sdr/blah [EMAIL PROTECTED] ~ $ -- gentoo-user

Re: [gentoo-user] [OT] Bash scripting

2005-11-11 Thread Jonathan Wright
Peper wrote: Hello, I have a var $blah=' `pwd`/blah ' (extra spaces for clearer reading), how can i change it to 'output of pwd/blah' ? What do you mean - are you looking for the actual phrase 'output of /path/to/blah', i.e. $blah='output of $(pwd)/blah' are are you looking for program out

Re: [gentoo-user] [OT] Bash scripting

2005-11-11 Thread David Eduardo Gómez Noguera
On Fri, 2005-11-11 at 14:56 +0100, Peper wrote: > Hello, > I have a var $blah=' `pwd`/blah ' (extra spaces for clearer reading), how can > i change it to 'output of pwd/blah' ? > try blah=`pwd`'/blah' *Note the single quotes do not enclose `pwd` -- David Eduardo Gómez Noguera <[EMAIL PROTECTE

[gentoo-user] [OT] Bash scripting

2005-11-11 Thread Peper
Hello, I have a var $blah=' `pwd`/blah ' (extra spaces for clearer reading), how can i change it to 'output of pwd/blah' ? -- Best Regards, Peper -- gentoo-user@gentoo.org mailing list