Terminal cp error

Directions:
Make a new directory called polygon. Copy the program lines.c ( or lines.cpp ) (from /pool/u/class/cs420/viewport) to your polygon directory.

I am in my polygon directory and I am trying to copy the lines.cpp file from viewport.

I input " cp -t /pool/u/class/cs420/draw/*&. " in terminal.

[1] 2617
bash: .: filename argument required
.: usage: . filename [arguments]
cp: cannot create regular file '/pool/u/class/cs420/viewport/11/bitmap': Permission denied
cp: cannot create regular file '/pool/u/class/cs420/viewport/11/bitmap.cpp': Permission denied
[003996459@jb356-5 polygon]$ cp: cannot create regular file '/pool/u/class/cs420/viewport/11/bitmap.o': Permission denied
cp: cannot create regular file '/pool/u/class/cs420/viewport/11/draw': Permission denied
cp: cannot create regular file '/pool/u/class/cs420/viewport/11/draw1': Permission denied
cp: cannot create regular file '/pool/u/class/cs420/viewport/11/draw1.cpp': Permission denied
cp: cannot create regular file '/pool/u/class/cs420/viewport/11/draw1.o': Permission denied
cp: cannot create regular file '/pool/u/class/cs420/viewport/11/draw.cpp': Permission denied
cp: cannot create regular file '/pool/u/class/cs420/viewport/11/drawFunc': Permission denied
cp: cannot create regular file '/pool/u/class/cs420/viewport/11/drawFunc.cpp': Permission denied
cp: cannot create regular file '/pool/u/class/cs420/viewport/11/drawFunc.o': Permission denied
cp: cannot create regular file '/pool/u/class/cs420/viewport/11/draw_main.cpp': Permission denied
cp: cannot create regular file '/pool/u/class/cs420/viewport/11/draw_main.o': Permission denied
cp: cannot create regular file '/pool/u/class/cs420/viewport/11/draw.o': Permission denied
cp: cannot create regular file '/pool/u/class/cs420/viewport/11/draw_point': Permission denied
cp: cannot create regular file '/pool/u/class/cs420/viewport/11/draw_point.cpp': Permission denied
cp: cannot create regular file '/pool/u/class/cs420/viewport/11/draw_point.o': Permission denied
cp: cannot create regular file '/pool/u/class/cs420/viewport/11/draw_poly': Permission denied
cp: cannot create regular file '/pool/u/class/cs420/viewport/11/draw_poly1': Permission denied
cp: cannot create regular file '/pool/u/class/cs420/viewport/11/draw_poly1.cpp': Permission denied
cp: cannot create regular file '/pool/u/class/cs420/viewport/11/draw_poly1.o': Permission denied
cp: cannot create regular file '/pool/u/class/cs420/viewport/11/draw_poly.cpp': Permission denied
cp: cannot create regular file '/pool/u/class/cs420/viewport/11/draw_poly.o': Permission denied
cp: cannot create regular file '/pool/u/class/cs420/viewport/11/fly': Permission denied
cp: cannot create regular file '/pool/u/class/cs420/viewport/11/fly.cpp': Permission denied
cp: cannot create regular file '/pool/u/class/cs420/viewport/11/fly.o': Permission denied
cp: cannot create regular file '/pool/u/class/cs420/viewport/11/lines': Permission denied
cp: cannot create regular file '/pool/u/class/cs420/viewport/11/lines.cpp': Permission denied
cp: cannot create regular file '/pool/u/class/cs420/viewport/11/lines.o': Permission denied
cp: cannot create regular file '/pool/u/class/cs420/viewport/11/Makefile': Permission denied
cp: cannot create regular file '/pool/u/class/cs420/viewport/11/Makefile.draw_poly': Permission denied
cp: cannot create regular file '/pool/u/class/cs420/viewport/11/t': Permission denied
cp: cannot create regular file '/pool/u/class/cs420/viewport/11/t1': Permission denied


How do I fix this and make these files appear in my polygon directory?
Last edited on
This has nothing to do with C++, but FWIW:
Copy the file named /pool/u/class/cs420/viewport/lines.c into the current directory:

% cp /pool/u/class/cs420/viewport/lines.c .
Note the trailing dot, which names the current directory. The white-space is important.
Last edited on
Fascinating.

First, there is use of A&B as in:
$ echo foo & echo bar
[1] 29281
bar
foo
[1]+  Done                    echo foo

Two separate commands on same line.
The A (echo foo) is launched asynchronously due to the &
The B (echo bar) executes synchronously.

In OP case the B is ., which is a bash builtin and alias for source.
This command requires a filename and thus generates the:
bash: .: filename argument required
.: usage: . filename [arguments]


The A is
cp -t /pool/u/class/cs420/draw/*
man cp says that
       -t, --target-directory=DIRECTORY
              copy all SOURCE arguments into DIRECTORY

Overall, man cp says
SYNOPSIS
       cp [OPTION]... [-T] SOURCE DEST
       cp [OPTION]... SOURCE... DIRECTORY
       cp [OPTION]... -t DIRECTORY SOURCE...
mbozzi did use the cp [OPTION]... SOURCE... DIRECTORY
* no OPTIONS
* SOURCE is /pool/u/class/cs420/viewport/lines.c
* DIRECTORY is .
Topic archived. No new replies allowed.