Re: [SLUG] Re: Tar over SSH

2001-10-23 Thread Herbert Xu

Mike Lake [EMAIL PROTECTED] wrote:
 On Mon, Oct 22, 2001 at 10:37:40PM +, Herbert Xu wrote:
 Angus Lees [EMAIL PROTECTED] wrote:
 
  only echo if bash is in interactive mode (don't know how you check
  that off the top of my head. in tcsh you see if $prompt is defined)
 
 [ ${-#*i} != $- ]

 Oh geez ! IMHO a little obfuscated I think.
 Thanks Jan and Steve, I shall try YOUR suggestions :-)

Obfuscated may be but the only technically correct solution IMHO :)
-- 
Debian GNU/Linux 2.2 is out! ( http://www.debian.org/ )
Email:  Herbert Xu ~{PmVHI~} [EMAIL PROTECTED]
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

-- 
SLUG - Sydney Linux User Group Mailing List - http://slug.org.au/
More Info: http://lists.slug.org.au/listinfo/slug



Re: [SLUG] Re: Tar over SSH

2001-10-22 Thread Steve Kowalik

At 11:33 pm, Sunday, October 21 2001, Angus Lees mumbled:
 several suggestions for your .bashrc:
 
  only echo if bash is in interactive mode (don't know how you check
  that off the top of my head. in tcsh you see if $prompt is defined)
 
The Debian .bashrc uses 'if [ $PS1 ]; then'
(In my mind, 'if [ ! -z $PS1 ]; then' sounds like a better plan.)

  only echo if stdout is a tty (test -t 1)

Nice plan.

  echo to stderr (echo foo 2) instead
 
  don't echo anything
 
Best method.

-- 
Steve
BOFH excuse #274: It was OK before you touched it.

 PGP signature


Re: [SLUG] Re: Tar over SSH

2001-10-22 Thread Jan Schmidt

quote who=Steve Kowalik

 The Debian .bashrc uses 'if [ $PS1 ]; then'
 (In my mind, 'if [ ! -z $PS1 ]; then' sounds like a better plan.)
 

Of course, why use no chars, when you can use three? If you absolutely want
an operand, why not 'if [ -n $PS1 ]; then' ?

I always like this technique best in login scripts...

J.
--
Jan Schmidt  [EMAIL PROTECTED]

Open Source Software: Free as in Free Speech, not Free Beer

 PGP signature


Re: [SLUG] Re: Tar over SSH

2001-10-22 Thread Herbert Xu

Angus Lees [EMAIL PROTECTED] wrote:

 only echo if bash is in interactive mode (don't know how you check
 that off the top of my head. in tcsh you see if $prompt is defined)

[ ${-#*i} != $- ]
-- 
Debian GNU/Linux 2.2 is out! ( http://www.debian.org/ )
Email:  Herbert Xu ~{PmVHI~} [EMAIL PROTECTED]
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

-- 
SLUG - Sydney Linux User Group Mailing List - http://slug.org.au/
More Info: http://lists.slug.org.au/listinfo/slug



Re: [SLUG] Re: Tar over SSH

2001-10-22 Thread Mike Lake

On Mon, Oct 22, 2001 at 10:37:40PM +, Herbert Xu wrote:
 Angus Lees [EMAIL PROTECTED] wrote:
 
  only echo if bash is in interactive mode (don't know how you check
  that off the top of my head. in tcsh you see if $prompt is defined)
 
 [ ${-#*i} != $- ]

Oh geez ! IMHO a little obfuscated I think.
Thanks Jan and Steve, I shall try YOUR suggestions :-)

Mike
-- 
You can't get very far in this world without your dossier being there first. -- 
Arthur Miller

Michael Lake, University of Technology, Sydney
Work: [EMAIL PROTECTED] Ph: 02 9514 1724 Fx: 02 9514 1628 
Home: http://www.speleonics.com.au
Linux enthusiast, active caver and interested in anything technical.
   ***



-- 
SLUG - Sydney Linux User Group Mailing List - http://slug.org.au/
More Info: http://lists.slug.org.au/listinfo/slug



[SLUG] Re: Tar over SSH

2001-10-21 Thread Angus Lees

\begin{Michael Lake}
 I have a few things echoed to the screen by .bashrc
 I can turn them off but there must be a way to ignore output of ssh before 
 root runs the tar program.

then thats a bug in your .bashrc

several suggestions for your .bashrc:

 only echo if bash is in interactive mode (don't know how you check
 that off the top of my head. in tcsh you see if $prompt is defined)

 only echo if stdout is a tty (test -t 1)

 echo to stderr (echo foo 2) instead

 don't echo anything


the only way around it that i can tell is to put some marker in then
strip off everything before the marker:

 ssh user@host 'echo __START-HERE__; tar cvf - /path' | \
  sed '1,/^__START-HERE__$/d' | dd of=/dev/mt0

but thats bodgy. fix the real problem, otherwise rsync, etc won't work
either.


note that (GNU) tar can do tar -f host:/path directly, using
whatever your rsh command ends up running (hopefully ssh). see
tar.info and rmt(8)

-- 
 - Gus

-- 
SLUG - Sydney Linux User Group Mailing List - http://slug.org.au/
More Info: http://lists.slug.org.au/listinfo/slug