Why does 'cp -f' not work anymore?

Michael Velez mikev777 at hotmail.com
Mon Nov 14 19:50:30 UTC 2005



> -----Original Message-----
> From: redhat-list-bounces at redhat.com [mailto:redhat-list-
> bounces at redhat.com] On Behalf Of Chris W. Parker
> Sent: Monday, November 14, 2005 1:56 PM
> To: General Red Hat Linux discussion list
> Subject: RE: Why does 'cp -f' not work anymore?
> 
> cs at zip.com.au <mailto:cs at zip.com.au>
>     on Thursday, November 03, 2005 2:57 PM said:
> 
> > Try this, addressing both problems:
> >
> >     cp()
> >     {
> >       __cp_iopt=-i
> >       for __cp_arg
> >       do  case "$__cp_arg" in
> > 	    --)	break ;;
> > 	    -f* | -[a-z]*f* | --force )
> > 		    __cp_iopt=; break ;;
> > 	    -*)	;;
> > 	    *)	break ;;
> >       done
> >       set -- $__cp_iopt ${1+"$@"}
> >       command cp "$@"
> >     }
> 
> I'm just getting around to doing this but I'm getting a syntax error.
> 
> -bash: /etc/bashrc: line 17: syntax error near unexpected token
> `newline'
> -bash: /etc/bashrc: line 17: `      done'
> 
> I'm copying/pasting exactly as it's found in the email.
> 
> 
> Thanks,
> Chris.
> 
> --
> redhat-list mailing list
> unsubscribe mailto:redhat-list-request at redhat.com?subject=unsubscribe
> https://www.redhat.com/mailman/listinfo/redhat-list


There needs to be the keyword "esac" (inverse of the word "case"), to close
the case statement, on a line before the keyword "done".

I believe that should do it.

Michael




More information about the redhat-list mailing list