From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 10952f,b69d377feb5a8a2 X-Google-Attributes: gid10952f,public X-Google-Thread: 1164f8,d4c1f7c0fe672a4 X-Google-Attributes: gid1164f8,public X-Google-Thread: 1020c6,d4c1f7c0fe672a4 X-Google-Attributes: gid1020c6,public X-Google-Thread: fcda7,d4c1f7c0fe672a4 X-Google-Attributes: gidfcda7,public X-Google-Thread: 10872d,d4c1f7c0fe672a4 X-Google-Attributes: gid10872d,public X-Google-Thread: 1070f0,d4c1f7c0fe672a4 X-Google-Attributes: gid1070f0,public From: "Steve \"Stevers!\" Coile" Subject: Re: Secure cleaning of /tmp was Different Unixes pros & cons Date: 1998/09/21 Message-ID: #1/1 X-Deja-AN: 393333636 References: <35F71814.1E0B911C@iakom.com> <3602E82F.C8638268@llnl.gov> <6tuuep$kks@web.nmti.com> <360674DF.C1EDCEAF@llnl.gov> <36067E43.598E55E1@llnl.gov> Content-Type: TEXT/PLAIN; charset=US-ASCII Organization: Red Hat Software Mime-Version: 1.0 Newsgroups: comp.unix.admin,comp.sys.hp.hpux,comp.sys.sgi.admin,comp.sys.sun.admin,comp.sys.dec,comp.security.unix On Mon, 21 Sep 1998, Jim Mellander wrote: [...] >How about a directory named `cat /etc/shadow` (including the back-quotes). >When I run cd "`cat /etc/shadow`" on Solaris 2.6 I get: Putting double quotes (") around a variable substitution prevents further interpretation of the variable value by the shell. Thus, if you had a file: /tmp/`cat /etc/shadow` (including the backtics in the name) and did the following: find /tmp -print \ | while read fs do ds="`dirname \"$fs\"`" fn="`basename \"$fs\"`" cd "$ds" && rm -f "$fn" done Note also that a file of the name: /tmp/`cat /etc/shadow` would actually refer to a file with the name: shadow` located in the directory: etc which is a subdirectory of the directory named: `cat located in /tmp. So the above script would be performing the equivalent of: cd '/tmp/`cat /etc' && rm -f 'shadow`' -- Steve Coile R e d H a t Systems Administration scoile@redhat.com S o f t w a r e