Scripting Evalsha
# Redis Evalsha Command | Rookie Tutorial
# [Rookie Tutorial -- Not just technology, but also dreams!](#)
* (javascript:void(0);)
* (javascript:void(0);)
* (javascript:void(0);)
* (javascript:void(0))
Redis Tutorial
(#)(#)(#)(#)(#)
## Redis Commands
(#)(#)(#)(#)(#)(#)(#)(#)[Redis Pub/Sub](#)(#)(#)(#)(#)(#)(#)
## Redis Advanced Tutorial
[Redis Backup & Recovery](#)(#)(#)(#)(#)(#)(#)(#)
[](#)(#)
(#)[](#)
In-depth Exploration
Scripting Language
Data Management
Script
SCRIPT
Programming
Scripts
Web Service
Computer Science
Software
Web Service
# Redis Evalsha Command
!(#)(#)
The Redis EVALSHA command executes a script cached on the server, using its sha1 digest as a reference.
The script can be loaded into the server's cache using the SCRIPT LOAD command.
In all other aspects, this command behaves identically to EVAL, including how arguments are passed.
### Syntax
The basic syntax of the redis Evalsha command is as follows:
redis 127.0.0.1:6379> EVALSHA sha1 numkeys key [key ...] arg [arg ...]
Parameter Description:
* **sha1**: The sha1 digest generated by SCRIPT LOAD.
* **numkeys**: Specifies the number of key name arguments.
* **key [key ...]**: Starting from the third argument of EVAL, these represent the Redis keys used within the script. These key name parameters can be accessed in Lua via the global KEYS array, using 1-based indexing (KEYS, KEYS, and so on).
* **arg [arg ...]**: Additional arguments, accessed in Lua via the global ARGV array, similar to the KEYS variable (ARGV, ARGV, etc.).
### Available Version
>= 2.6.0
### Example
redis 127.0.0.1:6379> SCRIPT LOAD "return 'hello moto'""232fd51614574cf0867b83d384a5e898cfd24e5a" redis 127.0.0.1:6379> EVALSHA "232fd51614574cf0867b83d384a5e898cfd24e5a" 0"hello moto"
!(#)(#)
AI is thinking...
[](#)(#)
[Redis S
YouTip