Skip to main content
added 8 characters in body; edited title
Source Link

Use the Bash 'cp' command in a Bash script and exclude a specific directory

I need to run this command fromin a shell script to copy source > destinationcopy source > destination and exclude a folder.

No rsync, tar, find, mv, etc.

Exactly this command:

cp -var test/!(test2) testbkp

  1. In the shell it works
  2. Run from a Bash script without exclude like cp -var test testbkp it works.

When I try to run from a Bash script with the exclude option   

cp -var test/!(test2) testbkp, it doesn't work. 

There isn't any output, nothing, and no error message.

I checked this post too, but no result: cp command won't run if executed from shell script

How can I run this cp command in a Bash script and exclude folders?

Use the Bash 'cp' command in a script and exclude a specific directory

I need to run this command from a shell script to copy source > destination and exclude a folder

No rsync, tar, find, mv, etc.

Exactly this command:

cp -var test/!(test2) testbkp

  1. In the shell it works
  2. Run from a Bash script without exclude like cp -var test testbkp it works.

When I try to run from a Bash script with the exclude option  cp -var test/!(test2) testbkp, it doesn't work. There isn't any output, nothing, and no error message.

I checked this post too, but no result: cp command won't run if executed from shell script

How can I run this cp command in a Bash script and exclude folders?

Use the 'cp' command in a Bash script and exclude a specific directory

I need to run this command in a shell script to copy source > destination and exclude a folder.

No rsync, tar, find, mv, etc.

Exactly this command:

cp -var test/!(test2) testbkp

  1. In the shell it works
  2. Run from a Bash script without exclude like cp -var test testbkp it works.

When I try to run from a Bash script with the exclude option 

cp -var test/!(test2) testbkp, it doesn't work. 

There isn't any output, nothing, and no error message.

I checked this post too, but no result: cp command won't run if executed from shell script

How can I run this cp command in a Bash script and exclude folders?

Use the Bash 'cp' command in a script and exclude a specific directory

I need to run this command from a shell script to copy source > destination and exclude a folder

No rsync, tar, find, mv, etc.

Exactly this command:

cp -var test/!(test2) testbkp

  1. inIn the shell it works
  2. runRun from a Bash script without exclude like cp -var test testbkp it works.

When I try to run from a Bash script with the exclude option cp -var test/!(test2) testbkp, it doesn't work. There isn't any output, nothing, and no error message.

I checked this post too, but no result: cp command won't run if executed from shell script

How can I run this cp command in a Bash script and exclude folders?

Use the Bash 'cp' command in script and exclude a specific directory

I need to run this command from a shell script to copy source > destination and exclude a folder

No rsync, tar, find, mv, etc.

Exactly this command:

cp -var test/!(test2) testbkp

  1. in the shell it works
  2. run from a Bash script without exclude like cp -var test testbkp it works.

When I try to run from a Bash script with the exclude option cp -var test/!(test2) testbkp, it doesn't work. There isn't any output, nothing, and no error message.

I checked this post too, but no result: cp command won't run if executed from shell script

How can I run this cp command in a Bash script and exclude folders?

Use the Bash 'cp' command in a script and exclude a specific directory

I need to run this command from a shell script to copy source > destination and exclude a folder

No rsync, tar, find, mv, etc.

Exactly this command:

cp -var test/!(test2) testbkp

  1. In the shell it works
  2. Run from a Bash script without exclude like cp -var test testbkp it works.

When I try to run from a Bash script with the exclude option cp -var test/!(test2) testbkp, it doesn't work. There isn't any output, nothing, and no error message.

I checked this post too, but no result: cp command won't run if executed from shell script

How can I run this cp command in a Bash script and exclude folders?

Copy edited (e.g. ref. <https://en.wikipedia.org/wiki/Bash_%28Unix_shell%29>). Expanded.
Source Link

use bash Use the Bash 'cp' command in script and exclude a specific directory?

I need to run this command from a shell script to copy source > destdestination and exclude a folder

noNo rsync, tar, find, mv, etc..

exactlyExactly this command:

cp -var test/!(test2) testbkp

  1. in the shell it works
  2. run from a bashBash script without exclude like cp -var test testbkp it works.

When I try to run from a bashBash script with the exclude option cp -var test/!(test2) testbkp it, it doesn't work, no. There isn't any output, nothing, and no error message.

I checked this post too, but no result: cp command won't run if executed from shell script

howHow can I run this cp command in a bashBash script and exclude folders?

use bash 'cp' command in script and exclude a specific directory?

I need to run this command from a shell script to copy source > dest and exclude a folder

no rsync, tar, find, mv, etc..

exactly this command:

cp -var test/!(test2) testbkp

  1. in the shell it works
  2. run from a bash script without exclude like cp -var test testbkp it works.

When I try to run from a bash script with the exclude option cp -var test/!(test2) testbkp it doesn't work, no output, nothing, no error message.

I checked this post too but no result: cp command won't run if executed from shell script

how can I run this cp command in a bash script and exclude folders?

Use the Bash 'cp' command in script and exclude a specific directory

I need to run this command from a shell script to copy source > destination and exclude a folder

No rsync, tar, find, mv, etc.

Exactly this command:

cp -var test/!(test2) testbkp

  1. in the shell it works
  2. run from a Bash script without exclude like cp -var test testbkp it works.

When I try to run from a Bash script with the exclude option cp -var test/!(test2) testbkp, it doesn't work. There isn't any output, nothing, and no error message.

I checked this post too, but no result: cp command won't run if executed from shell script

How can I run this cp command in a Bash script and exclude folders?

Became Hot Network Question
Source Link
Loading