cp -n

pupit: beginner's question: how to issue a command that copies a file to /bin and if that file is already there to not copy it over again? so i know: cp file /bin; if /bin/file then WHAT; else cp file /bin ?
erUSUL: pupit: cp -i file /bin ?
prince_jammys: -n
pupit: erUSUL: thanks!
pupit: man cp says its -n
pupit: so -i and -n is same?
erUSUL: pupit: no the same; -i asks the user
pupit: yes, thanks. i dont want to ask me as it wiil go in rc.local so its -n then
erUSUL: correct
pupit: tbh i didnt know cp has so many options!
erUSUL: ~30 years of existence can acumulate some cruft ;P
pupit: haha
humpty: where does that -n option come from? I don't find trace of it through my googling
ferret: It's specific to gnu cp
ferret: Googling is not the way to reference command documentation, by the way
cthuluh: to recent versions of gnu cp, I guess
ferret: I don't believe it is particularly recent
humpty: I use GNU cp from coreutils 6.2.9, no mention
cthuluh: I do believe that my debian is old :)
prince_jammys: cp -i foo bar -n
ferret: Hm.
prince_jammys: echo n|cp -i foo bar ,posixly
Riviera: < /dev/null should do humpty: it's present in Squeeze, not Lenny: -n, --no-clobber erUSUL: i guess pupit was thinking of something like --> if ! test -f /bin/file; then cp file /bin/ ; fi

Нема коментара:

Постави коментар