So I have a script that adds 2 films together using the audio from the $1.audio file. What I would like to do is rename any file in the directory with:*.mp4 To:*.audio Keeping original file name.
Find all [filename].mp4 and rename [filename].audio
files;find;rename
You can use the rename command.  It's not portable, but it exists in different forms in different distributions.In CentOS/RHEL and probably Fedora:rename .mp4 .audio *.mp4Should do it.  From man rename on CentOS 6:SYNOPSIS       rename from to file...       rename -VDESCRIPTION       rename  will  rename  the specified files by replacing the first occur-       rence of from in their name by to.In Ubuntu and probably any Debian variant:rename 's/\.mp4$/.audio/' *.mp4should do it.  From man rename on Ubuntu 14.04:SYNOPSIS       rename [ -v ] [ -n ] [ -f ] perlexpr [ files ]DESCRIPTION       rename renames the filenames supplied according to the rule specified       as the first argument.  The perlexpr argument is a Perl expression       which is expected to modify the $_ string in Perl for at least some of       the filenames specified.  If a given filename is not modified by the       expression, it will not be renamed.  If no filenames are given on the       command line, filenames will be read via standard input.       For example, to rename all files matching *.bak to strip the       extension, you might say               rename 's/\.bak$//' *.bak