shellsips

How to output the sips image in directory


sips --resampleWidth 300 --out ./changedPic/A.png ./Normal/A.png 

I did this command in shell.

however it didn't make the A.png under changedPic directory but made 'changedPic' file.

It's not normal behavior of shell script though,,, How can I make A.png under changePic??


Solution

  • You need to make the directory first if it doesn't exist:

    mkdir -p ./changedPic; sips --resampleWidth 300 --out ./changedPic/A.png ./Normal/A.png 
    

    Use the -p option to ignore the error if the directory already exists.