bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Problem with open and rm


From: Eric Blake
Subject: Re: Problem with open and rm
Date: Wed, 16 Mar 2011 12:46:09 -0600
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.13) Gecko/20101209 Fedora/3.1.7-0.35.b3pre.fc14 Lightning/1.0b3pre Mnenhy/0.8.3 Thunderbird/3.1.7

On 03/16/2011 04:54 AM, Barrie Stott wrote:
> The script that follows is a cut down version of one that came from elsewhere.
> 
> #!/bin/bash
> 
> cp /tmp/x.html /tmp/$$.html
> ls /tmp/$$.html
> [ "$DISPLAY" ] && open /tmp/$$.html
> ls /tmp/$$.html
> rm -f /tmp/$$.html

Instead of passing Safari the name of a temporary file, why not pass it
the name of a temporary pipe?  Does this work any better:

[ "$DISPLAY" ] && open <(cat /tmp/x.html)

at which point there's no temporary file to remove.

-- 
Eric Blake   address@hidden    +1-801-349-2682
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]