You are not logged in.

#1 2012-09-17 08:57:47

aardwolf
Member
From: Belgium
Registered: 2005-07-23
Posts: 305

Making bash ask for confirmation of overwrite when using > ?

Hi,

Is there a way to let bash confirm overwrite of file when using the > redirection operator to a filename that already exists?

But not for >>. And not if > is used in an sh file, only if I type it manually.

Thanks!

Last edited by aardwolf (2012-09-17 08:58:37)

Offline

#2 2012-09-17 09:06:52

bernarcher
Forum Fellow
From: Germany
Registered: 2009-02-17
Posts: 2,281

Re: Making bash ask for confirmation of overwrite when using > ?

Moving to Programming & Scripting.


To know or not to know ...
... the questions remain forever.

Offline

#3 2012-09-17 09:10:10

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,426
Website

Re: Making bash ask for confirmation of overwrite when using > ?

set -o noclobber

Forces you to type >|


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

Board footer

Powered by FluxBB