I am using a script called conv-script
that I found on AskUbuntu here. It looks like this
#!/bin/sh
readarray -t files < wma-files.txt
for file in "${files[@]}"; do
out=${file%.wma}.mp3
probe=`avprobe -show_streams "$file" 2>/dev/null`
rate=`echo "$probe" | grep "^bit_rate" | sed "s:.*=\(.*\)[0-9][0-9][0-9][.].*:\1:" | head -1`
ffmpeg -i "$file" -ab "$rate"k "$out" && rm "$file"
done
I have ran sudo chmod +x ./conv-script
and then I try and execute it with sudo ./conv-script
After doing so I get an error sudo: ./conv-script: command not found
I am unsure what I am doing wrong as I can see the file in the current working directory and I have set it to be executable. One thing I thought it might be was the first line of my script is wrong, but I have another script with the same shebang and it executes fine. When I use the shebang in the original #!/usr/bin/env bash
I get the same thing. Thanks for the help
EDIT:
output of file conv-script
conv-script: a /usr/bin/env bash script, ASCII text executable
output of stat conv-script
File: ‘conv-script’
Size: 325 Blocks: 64 IO Block: 32768 regular file
Device: 821h/2081d Inode: 82004 Links: 1
Access: (0644/-rw-r--r--) Uid: ( 1000/ kalenpw) Gid: ( 1000/ kalenpw)
Access: 2016-05-17 16:40:43.000000000 -0600
Modify: 2016-05-17 14:33:31.000000000 -0600
Change: 2016-05-17 14:33:32.000000000 -0600
Birth: -
file conv-script
andstat conv-script
.cd Downloads
orcd Music
.sudo
. @mikewhatever, he's already in the right directory becausechmod
is not failing.