You would need something like:
cp /bin/ls/blah .
cat blah blah blah >bbb
chmod u+x bbb
./bbb
The first difference is the number of parameters to cp
. You need to specify the destination as well as the source. The second difference is that unless you have the current directory in the path, you need to use ./command
instead of just command
to execute a program residing in the current directory.
Besides that, it would important to know what is the content of /bin/ls/blah
. If that file is a bash script containing something like:
#!/bin/ls
ls
the modified block of code given at the beginning of this answer will work as expected (printing 3 times the contents of the current directory). If the file is a binary file, it most probably would not work, since you cannot concatenate binary files and expect the resulting file to behave as 3 sequential executions of the original binary file.
UPDATE: After your edit, the answer clearly changes. Now, only the last part applies to it. Since /bin/ls
is a binary file, you cannot concatenate binary files and expect the resulting file to behave as 3 sequential executions of the original binary file. If instead of a binary file you were using a script the example would work, though.