From owner-freebsd-questions@FreeBSD.ORG Sun Oct 12 08:42:58 2008 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0BA551065689 for ; Sun, 12 Oct 2008 08:42:58 +0000 (UTC) (envelope-from m.seaman@infracaninophile.co.uk) Received: from smtp.infracaninophile.co.uk (gate6.infracaninophile.co.uk [IPv6:2001:8b0:151:1::1]) by mx1.freebsd.org (Postfix) with ESMTP id 834E48FC17 for ; Sun, 12 Oct 2008 08:42:57 +0000 (UTC) (envelope-from m.seaman@infracaninophile.co.uk) Received: from happy-idiot-talk.infracaninophile.co.uk (localhost [IPv6:::1]) (authenticated bits=0) by smtp.infracaninophile.co.uk (8.14.3/8.14.3) with ESMTP id m9C8gnxg043198; Sun, 12 Oct 2008 09:42:50 +0100 (BST) (envelope-from m.seaman@infracaninophile.co.uk) X-DKIM: Sendmail DKIM Filter v2.7.2 smtp.infracaninophile.co.uk m9C8gnxg043198 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=infracaninophile.co.uk; s=200708; t=1223800971; bh=JCKeMWGmpb7Qbf PR/2EDKUnmKsZDYuRIleCcWASqaNQ=; h=Message-ID:Date:From:MIME-Version: To:CC:Subject:References:In-Reply-To:Content-Type:Cc:Content-Type: Date:From:In-Reply-To:Message-ID:Mime-Version:References:To; z=Mes sage-ID:=20<48F1B87E.6010803@infracaninophile.co.uk>|Date:=20Sun,=2 012=20Oct=202008=2009:42:38=20+0100|From:=20Matthew=20Seaman=20|Organization:=20Infracaninophile|User -Agent:=20Thunderbird=202.0.0.17=20(X11/20080929)|MIME-Version:=201 .0|To:=20mdh_lists@yahoo.com|CC:=20FreeBSD=20Mailing=20List=20,=20=0D=0A=20Gary=20Kline=20|Subject:=20Re:=20rsync=20or=20even=20scp=20questions....|Ref erences:=20<7708.70177.qm@web56801.mail.re3.yahoo.com>|In-Reply-To: =20<7708.70177.qm@web56801.mail.re3.yahoo.com>|X-Enigmail-Version:= 200.95.6|Content-Type:=20multipart/signed=3B=20micalg=3Dpgp-sha256= 3B=0D=0A=20protocol=3D"application/pgp-signature"=3B=0D=0A=20bounda ry=3D"------------enigF7F2052B3717C3B67B75BF41"; b=zPLsWxNEIx7HgdQf 5ING1Ybd0cqTIPD2DW8QTwdu5iiOuQ8QuPBrvgozgMyAz9eTikMx5fujUo0ee6JNNdW 8B9BTSLHicYomzi8nub8dbA1Dbzdy2lvsJA4tH5TCz4SZ+5vsujr9C/fAtlDHleqdcb tmwVU89l6hahNMRu9UoRc= Message-ID: <48F1B87E.6010803@infracaninophile.co.uk> Date: Sun, 12 Oct 2008 09:42:38 +0100 From: Matthew Seaman Organization: Infracaninophile User-Agent: Thunderbird 2.0.0.17 (X11/20080929) MIME-Version: 1.0 To: mdh_lists@yahoo.com References: <7708.70177.qm@web56801.mail.re3.yahoo.com> In-Reply-To: <7708.70177.qm@web56801.mail.re3.yahoo.com> X-Enigmail-Version: 0.95.6 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="------------enigF7F2052B3717C3B67B75BF41" X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.0.1 (smtp.infracaninophile.co.uk [IPv6:::1]); Sun, 12 Oct 2008 09:42:51 +0100 (BST) X-Virus-Scanned: ClamAV 0.94/8414/Sun Oct 12 04:30:50 2008 on happy-idiot-talk.infracaninophile.co.uk X-Virus-Status: Clean X-Spam-Status: No, score=-2.9 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED, DKIM_VERIFIED,NO_RELAYS autolearn=ham version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on happy-idiot-talk.infracaninophile.co.uk Cc: Gary Kline , FreeBSD Mailing List Subject: Re: rsync or even scp questions.... X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 12 Oct 2008 08:42:58 -0000 This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enigF7F2052B3717C3B67B75BF41 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: quoted-printable mdh wrote: > --- On Sat, 10/11/08, Gary Kline wrote: >> On the Ubuntu computer I am /home/kline; on my main >> computer, >> my home is /usr/home/kline. The following sh script >> worked >> perfected when my home on "tao" [FBSD] was >> /home/kline: >> >> P >> #!/bin/sh >> >> PWD=3D`pwd`; >> echo "This directory is [${PWD}]"; >> >> scp -qrp ${PWD}/* ethos:/${PWD} >> ###/usr/bin/scp -rqp -i /home/kline/.ssh/zeropasswd-id >> ${PWD}/* \ klin >> e@ethos:/${PWD} >> >> Question #1: is there any /bin/sh method of getting rid of >> the >> "/usr"? I switch off between my two computers >> especially when >> get mucked up, as with my upgrade to kde4. (Otherwise, I >> do >> backups of ~kline as well as other critical directories.) >> >> Is there a way of automatically using rsync rather that my >> kwik-and-dirty /bin/shell script? >> >> thanks, people, >> >> gary >=20 > If what you wish to do is simply get rid of /usr in a string, you can u= se sed like so: > varWithoutUsr=3D`echo ${varWithUsr} |sed -e 's/\/usr//'` > After running this, where $varWithUsr is the variable containing a stri= ng like "/usr/home/blah", the variable $varWithoutUsr will be equal to "/= home/blah". I create simple scripts like this all the time to rename bat= ches of files, for example. =20 >=20 > The easier way is probably just to not specify a dir to scp's remote pa= th though, since it defaults to the user's home directory. =20 Or, in anything resembling Bourne shell: varWithoutUsr=3D${varWithUsr#/usr} Cheers, Matthew --=20 Dr Matthew J Seaman MA, D.Phil. 7 Priory Courtyard Flat 3 PGP: http://www.infracaninophile.co.uk/pgpkey Ramsgate Kent, CT11 9PW --------------enigF7F2052B3717C3B67B75BF41 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.9 (FreeBSD) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iEYEAREIAAYFAkjxuIkACgkQ8Mjk52CukIxuVQCgkJ27dRDE1MRfa9WYgRuqbHjq tfwAni/rEu/wvVPC0Y12l77Y6FuD2Dmz =Vuiw -----END PGP SIGNATURE----- --------------enigF7F2052B3717C3B67B75BF41--