Date: Tue, 25 Oct 2022 23:14:42 +0100 From: Nuno Teixeira <eduardo@freebsd.org> To: FreeBSD Mailing List <freebsd-ports@freebsd.org> Subject: sh: getting <category>/<portname> from pwd Message-ID: <CAFDf7UJp9PkrhfMmJRKO7QNTmGQYu7BQYyqczoz-Dy7hP3h74g@mail.gmail.com>
next in thread | raw e-mail | index | archive | help
--000000000000c6968005ebe33c4d Content-Type: text/plain; charset="UTF-8" Hello all, I'm writing a shell script to feed poudriere testports and I need to get <category>/<portname> from ports tree: `pwd`: /home/user/work/freebsd/ports/<category>/<portname> `pwd | rev | cut -d / -f1,2 | rev` do the trick but it is so uggly! Is there a shell option to get it? Thanks, -- Nuno Teixeira FreeBSD Committer (ports) --000000000000c6968005ebe33c4d Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable <div dir=3D"ltr"><div>Hello all,</div><div><br></div><div>I'm writing a= shell script to feed poudriere testports and I need to get <category>= ;/<portname> from ports tree:</div><div><br></div><div>`pwd`:<br></di= v><div>/home/user/work/freebsd/ports/<category>/<portname></div= ><div><br></div><div>`pwd | rev | cut -d / -f1,2 | rev` do the trick but it= is so uggly!</div><div><br></div><div>Is there a shell option to get it?</= div><div><br></div><div>Thanks,<br>-- <br><div dir=3D"ltr" class=3D"gmail_s= ignature" data-smartmail=3D"gmail_signature"><div dir=3D"ltr"><span style= =3D"color:rgb(102,102,102)">Nuno Teixeira<br>FreeBSD Committer (ports)</spa= n></div></div></div></div> --000000000000c6968005ebe33c4d--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAFDf7UJp9PkrhfMmJRKO7QNTmGQYu7BQYyqczoz-Dy7hP3h74g>