From owner-freebsd-questions Wed Jul 29 06:19:33 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id GAA20905 for freebsd-questions-outgoing; Wed, 29 Jul 1998 06:19:33 -0700 (PDT) (envelope-from owner-freebsd-questions@FreeBSD.ORG) Received: from plains.NoDak.edu (tinguely@plains.NoDak.edu [134.129.111.64]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id GAA20897 for ; Wed, 29 Jul 1998 06:19:29 -0700 (PDT) (envelope-from tinguely@plains.NoDak.edu) Received: (from tinguely@localhost) by plains.NoDak.edu (8.8.8/8.8.8) id IAA13690; Wed, 29 Jul 1998 08:18:44 -0500 (CDT) Date: Wed, 29 Jul 1998 08:18:44 -0500 (CDT) From: Mark Tinguely Message-Id: <199807291318.IAA13690@plains.NoDak.edu> To: tinguely@plains.NoDak.edu, wolstena@sfu.ca Subject: Re: Moving passwd files from LINUX to FreeBSD Cc: alex@muse.org.au, freebsd-questions@FreeBSD.ORG Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG > I wanted to do a quick and > dirty change to the home directory path but I can't figure out how to add > a "/" to the replacement string using sed. I wanted to make a global > change to the home directory location -- /Users --> /home/edwina > > I tried: > > sed s/Users/home\/edwina/g passwd.file > passwd.new close add the single quote to the substitute command: sed 's/Users/home\/edwina/g' passwd.file > passwd.new you can do this substitution in 'vipw' with vi as the EDITOR, and it will save you the pwd_mkdb step. (ie: # setenv EDITOR /usr/bin/vi # or export EDITOR=/usr/bin/vi for sh/bash # vipw :G :1,.s/User/home\/edwina/g :wq ) --mark. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message