سلام دوستان
قطعه کد sql زیر رو داخل یک shell script گذاشتم ولی عمل نمیکنه . فکر میکنم مشکل از escape کردن چرکتر ها باشه ولی نتونستم حلش کنم .
این کد باید 5 تا ورودی رو از ترمینال بگیره 1$ الی 5$ و بعد اونارو وارد یک دیتابیس به اسم objects و داخل جدول object ذخیره کنه ولی بعد از این که اجراش میکنم خروجی زیر رو میده که انگار دستور اشتباه است
#/bin/bash
`mysql -u root -p"1234" -e insert into object values\("$1","$2","$3","$4","$5"\);`
aliali@lp:/tmp$ source sql.sh banana yellow 6 soft 1
mysql Ver 14.14 Distrib 5.5.35, for debian-linux-gnu (x86_64) using readline 6.2
Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Usage: mysql [OPTIONS] [database]
-?, --help Display this help and exit.
-I, --help Synonym for -?
--auto-rehash Enable automatic rehashing. One doesn't need to use
'rehash' to get table and field completion, but startup
and reconnecting may take a longer time. Disable with
--disable-auto-rehash.
(Defaults to on; use --skip-auto-rehash to disable.)
-A, --no-auto-rehash
No automatic rehashing. One has to use 'rehash' to get
table and field completion. This gives a quicker start of
mysql and disables rehashing on reconnect.
--auto-vertical-output
Automatically switch to vertical output mode if the
result is wider than the terminal width.
-B, --batch Don't use history file. Disable interactive behavior.
(Enables --silent.)
--character-sets-dir=name
Directory for character set files.
--column-type-info Display column type in
پیشاپیش ممنون