On Tue, 1 Feb 2022, Michael Stillwell wrote:

> I occasionally need to do various tasks that require the creation of a
> temporary directory, something like:
> 
> $ mkdir tmp
> $ cd tmp
> $ unzip ../foo.zip
> $ # do something to the contents of tmp
> $ cd ..
> $ rm -rf tmp
> 
> What's the idiomatic fish way of creating the directory (with a random,
> unique name) and ensuring it's deleted? Do I need to dirty my hands with
> /usr/bin/mktemp??

fish internally uses `mktemp -d` and I would recommend it.

You do have to be careful about cleanup. 
https://github.com/fish-shell/fish-shell/issues/2828 details some proposed 
enhancements which would make this easier.

David Adam
zanc...@ucc.gu.uwa.edu.au


_______________________________________________
Fish-users mailing list
Fish-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/fish-users

Reply via email to