Date: Thu, 29 Jan 2004 22:24:08 +0800 From: "Zhang Weiwu" <weiwuzhang@hotmail.com> To: questions@freebsd.org Subject: use \000 in sed Message-ID: <LAW11-F18PNBhMPHOuj000322b7@hotmail.com>
next in thread | raw e-mail | index | archive | help
Hello. I wish to see all the files in some pathes in a string. Say, I wish to list all files in $PATH and manpath(1) What I can think of is to use #manpath | sed "s/:/ /g" |xargs ls (This is useful when auto-completing man command in a shell, say, csh). This works, but the command is wrong when a path contain a space in it. I think a better way is to replace ":" with \000, the "NULL". In this way I can use "xargs -0" to pass all pathes to ls(1) #manpath | sed s/:/\000/g" |xargs -0 ls Only I don't know how to let sed(1) understand \000 is the actual ascii code 0 not the string "000". Any hints? Thank you very much. _________________________________________________________________ 享用世界上最大的电子邮件系统— MSN Hotmail。 http://www.hotmail.com
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?LAW11-F18PNBhMPHOuj000322b7>