当前位置:网站首页>Restcloud ETL resolves shell script parameterization
Restcloud ETL resolves shell script parameterization
2022-06-26 15:15:00 【RestCloud】

RestCloud ETL Community Edition is a data integration tool , Provide visual multi data pipeline construction 、 Data source management 、 Operation monitoring and authority management functions .
RestCloud How to transfer variables into the platform shell Use in script , There are two ways to run in the platform shell Script , Namely Script code in component and Call script file , There are different ways to obtain variables according to different operation modes .
1. Script in component
The method of obtaining variables for scripting in components is the same as that for other components , Use ${ Variable id} You can get the variable data . As shown in the figure below :

Here is a simple process , Input the data of a field in the database table as a variable item by item into shell In the script .

Here is the database data , The name will be used as a variable in the process .
The configuration of the library table input component is skipped , Simply read the output data successfully .

Output line by line. Here, you need to convert the field data into variable data and output it to the next node .

Here is shell Script configuration , Write a simple script , Use ${ Variable id} Call the variable data passed in from the previous node .

After running, you can see that you have successfully passed ${ full name } Get the data output from the database .
2. Call script file
This is the call that has been written shell Script files , The name of the variable is not defined in the script file , Use it directly $ Variable id This method can successfully call the variables passed in the process . Here's the picture :

The above process and database are also used here , Just a little modification shell Script content of the component .

Because it is a read script file , Here you need to fill in the directory where the script is located . stay shell Run the file in the script and use ${ Variable id} To get variables , Be careful : If there are multiple variables, you need to pay attention to the order of variables .

Here, enter the directory where the file is located and use pwd View the current path address .

Use vim File name Enter the script file to edit the script code , Here you simply print the first variable and one hello, Use... In documents $1~$n To add a pass to Shell Variable value .$1 It's No 1 Variable 、$2 It's No 2 Variable ….
Configuration complete , View the results after running .

You can see shell Successfully obtained variable data , Output to the log .

Thank you for your attention and support ! For more features , Please join RestCloud ETL Community free download experience , Download address :https://etl.restcloud.cn
边栏推荐
猜你喜欢

About selenium common. exceptions. Webdriverexception: message: an unknown server side error solution (resolved)

数据库-完整性约束

小程序:uniapp解决 vendor.js 体积过大的问题

Inaccurate data accuracy in ETL process

【TcaplusDB知识库】TcaplusDB系统用户组介绍

【ceph】CephFS 内部实现(二):示例--未消化

RestCloud ETL抽取动态库表数据实践

Database - sequence

【TcaplusDB知识库】TcaplusDB数据构造介绍

BLE抓包调试信息分析
随机推荐
数据库-完整性约束
Pod scheduling of kubernetes
TCP拥塞控制详解 | 1. 概述
PHP file upload 00 truncation
Sikuli 基于图形识别的自动化测试技术
R语言epiDisplay包的dotplot函数通过点图的形式可视化不同区间数据点的频率、使用by参数指定分组参数可视化不同分组的点图分布、使用cex.X.axis参数指定X轴轴刻度数值标签字体的大小
Restcloud ETL extraction de données de table de base de données dynamique
【TcaplusDB知识库】TcaplusDB OMS业务人员权限介绍
Unity C # e-learning (10) -- unitywebrequest (1)
Pod of kubernetes
[CEPH] cephfs internal implementation (II): example -- undigested
【TcaplusDB知识库】TcaplusDB单据受理-建表审批介绍
【TcaplusDB知识库】TcaplusDB单据受理-创建业务介绍
功能:crypto-js加密解密
【ceph】CEPHFS 内部实现(一):概念篇--未消化
【TcaplusDB知识库】TcaplusDB单据受理-事务执行介绍
Is it safe to open a stock account through the account opening link of the broker manager? Or is it safe to open an account in a securities company?
Program analysis and Optimization - 8 register allocation
聊聊几位大厂清华同学的近况
RestCloud ETL抽取動態庫錶數據實踐