From nobody Wed Oct 26 02:10:09 2022 X-Original-To: freebsd-ports@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Mxshg74CTz4gjfQ for ; Wed, 26 Oct 2022 02:10:11 +0000 (UTC) (envelope-from pauamma@freebsd.org) Received: from mail.gundo.com (gibson.gundo.com [75.145.166.65]) by mx1.freebsd.org (Postfix) with ESMTP id 4Mxshg26sQz4826; Wed, 26 Oct 2022 02:10:11 +0000 (UTC) (envelope-from pauamma@freebsd.org) Received: from webmail.gundo.com (variax.gundo.com [75.145.166.70]) by mail.gundo.com (Postfix) with ESMTP id 2E8DF4C03F2; Tue, 25 Oct 2022 21:10:10 -0500 (CDT) List-Id: Porting software to FreeBSD List-Archive: https://lists.freebsd.org/archives/freebsd-ports List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-ports@freebsd.org X-BeenThere: freebsd-ports@freebsd.org MIME-Version: 1.0 Date: Wed, 26 Oct 2022 02:10:09 +0000 From: Pau Amma To: Nuno Teixeira Cc: FreeBSD Mailing List Subject: Re: sh: getting / from pwd Reply-To: pauamma@freebsd.org In-Reply-To: References: User-Agent: Roundcube Webmail/1.4.8 Message-ID: <637c1f11cd7428ce27da2adbbb558c43@freebsd.org> X-Sender: pauamma@freebsd.org Organization: The FreeBSD Project Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 4Mxshg26sQz4826 X-Spamd-Bar: / Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=softfail (mx1.freebsd.org: 75.145.166.65 is neither permitted nor denied by domain of pauamma@freebsd.org) smtp.mailfrom=pauamma@freebsd.org X-Spamd-Result: default: False [0.20 / 15.00]; VIOLATED_DIRECT_SPF(3.50)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; NEURAL_HAM_SHORT(-1.00)[-0.999]; NEURAL_HAM_LONG(-1.00)[-0.999]; RCVD_IN_DNSWL_MED(-0.20)[75.145.166.65:from]; RWL_MAILSPIKE_GOOD(-0.10)[75.145.166.65:from]; MIME_GOOD(-0.10)[text/plain]; RCVD_NO_TLS_LAST(0.10)[]; HAS_REPLYTO(0.00)[pauamma@freebsd.org]; FREEFALL_USER(0.00)[pauamma]; FROM_HAS_DN(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; DMARC_NA(0.00)[freebsd.org]; ARC_NA(0.00)[]; MID_RHS_MATCH_FROM(0.00)[]; MIME_TRACE(0.00)[0:+]; MLMMJ_DEST(0.00)[freebsd-ports@freebsd.org]; HAS_ORG_HEADER(0.00)[]; R_SPF_SOFTFAIL(0.00)[~all]; REPLYTO_ADDR_EQ_FROM(0.00)[]; ASN(0.00)[asn:7922, ipnet:75.144.0.0/13, country:US]; TO_DN_ALL(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; RCPT_COUNT_TWO(0.00)[2]; R_DKIM_NA(0.00)[]; RCVD_COUNT_TWO(0.00)[2] X-ThisMailContainsUnwantedMimeParts: N On 2022-10-25 22:14, Nuno Teixeira wrote: > I'm writing a shell script to feed poudriere testports and I need to > get > / from ports tree: > > `pwd`: > /home/user/work/freebsd/ports// > > `pwd | rev | cut -d / -f1,2 | rev` do the trick but it is so uggly! > > Is there a shell option to get it? I'd use basename(1) and dirname(1). -- #BlackLivesMatter #TransWomenAreWomen #AccessibilityMatters #StandWithUkrainians English: he/him/his (singular they/them/their/theirs OK) French: il/le/lui (iel/iel and ielle/ielle OK) Tagalog: siya/niya/kaniya (please avoid sila/nila/kanila)