I have a script called rename, and where it states ./wid_*.jil I want to be able to enter that information from the command line while executing the script.  for file in ./wid_*.jildo    mv -i ${file} ${file/orig/update}doneOn the command line I would like to be able to enter [user@location dir1]$ rename dir2/The script would then look in dir2/ and rename all files with orig in their name to update.I'm very new to unix/linux so I apologize if my terminology is off, or if my description is poor.
How do I change the input of a script to be the first argument on the CLI?
scripting;rename
$1 will be the first argument of your bash script:#!/bin/bashdirectory=$1echo $directoryYou can also perform some checks, e.g.#!/bin/bashdirectory=$1[ -z $directory ] && echo Please provide a directory && exit 1[ ! -d $directory ] && echo Directory not found && exit 2for file in $directory/wid_*.jildo    mv -i ${file} ${file/orig/update}done