Search notes:

Script: mvnd

#
#  Move a file to a directory to be newly created
#

if [[ "$#" < 2 ]]; then
  echo "mvnd file-name new-directory-name"
  exit -1
fi

file_name=$1
dir_name=$2

if [[ -e "$dir_name" ]]; then
  echo $dir_name already exists
  exit -1
fi

if [[ ! -f "$file_name" ]]; then
  echo "$file_name does not exist"
  exit -1
fi

mkdir "$dir_name"

mv "$file_name" "$dir_name"
Github repository scripts-and-utilities, path: /mvnd

See also

Scripts

Index

Fatal error: Uncaught PDOException: SQLSTATE[HY000]: General error: 8 attempt to write a readonly database in /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php:78 Stack trace: #0 /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php(78): PDOStatement->execute(Array) #1 /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php(30): insert_webrequest_('/notes/developm...', 1759390647, '216.73.216.42', 'Mozilla/5.0 App...', NULL) #2 /home/httpd/vhosts/renenyffenegger.ch/httpsdocs/notes/development/tools/scripts/personal/mvnd(62): insert_webrequest() #3 {main} thrown in /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php on line 78