0

The code I have written has some errors:

cd OS2/OS22
for f in *.jpg
do
     cp -v "$f" OS! "${f%.jpg}"
done

It says: cp: target 'photo' is not a directory. *Can someone please advise how can I correct the code, or if there is a different way/code to implement the request.

1 Answer 1

0

You have to change the path to ../../OS1

#!/bin/bash
cd OS2/OS22
for f in *.jpg
do
  cp -v $f ../../OS1
done

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .