Hello I have the following bash code:
#!/bin/bash
arr=( "$@" )
echo "${arr[1]}"
echo "${arr[3]}"
echo "${arr[2]}"
mkdir "${arr[1]}/segments"
echo pwd
cd "${arr[1]}/segments"
mkdir "${arr[1]}/segments/${arr[3]}/segment_${arr[2]}"
cd "${arr[3]}/segment_${arr[2]}"
echo pwd
read -p "aa: " cuvant
The echos are for me to understand what exactly is going on. I spitted the "mkdir" command in order to see if it is creating a folder or not. The outcome of the script is:
As you can see is not creating the other folder underneath the streams folder.
I have also a similar code that is actually doing the work:
mkdir "${arr[1]}_720_directory"
ffmpeg -i ${arr[1]} -vf scale=1280:720 -preset slow -crf 18 "${arr[1]}_720_directory/output.mp4"
arr1=("${arr[1]}_720_directory/output.mp4" "$resolution" )
bash "$path"/check_resolution_video.sh "${arr1[@]}"
bash "$path"/bitrate.sh "${arr[1]}_720_directory" "output.mp4" "${arr[0]}" "$path"
This code is calling another file which is creating different bit-rates and that file will call the script which is not working.
The result:
Here is the segments folder and the new folder that was created.
In this case I do not know what can be the actual error of the "mkdir" command. If you have any suggestion just let me know please.
mkdir -p
– steeldriver May 05 '23 at 10:43