shell 编程实例之shell 常规用法及shell 函数

shell编程之循环语句与函数 判断while后的条件测试操作结果,如果条件成立,则执行do……done循环体中的命令序列,返回while后再次判断条件测试结果,如果条件仍然成立,则继续执行循环体,再次返回到while后,判断测试条件结果……作用:在执行循环语句时,可以根据特定条件反复执行命令序列,直到该条件不满足时,在脚本中避免死循环情况,可在循环体内的命令序列中修改测试条件的语句,当测试条件不再成立时,从而结束循环。注:在使用函数参数时,函数名称在前参数在后,函数名与参数之间用空格分隔,可以有多个参数,参数使用$1、 2、3…… 阅读详情

一、shell 常规用法

1.获取当前脚本执行目录

   SCRIPT_DIR="$(cd "$( dirname "$0")" && pwd)"

2.字符串切分,获得当前目录的父级目录

 ESEN_PETA=${ SCRIPT_DIR%/*}

3.更改默认换行符,实现将字符串变成数组

IFS_BLANK=$IFS
IFS="  ,"

在脚本最后执行IFS=$IFS_BLANK

4.关联数组,类似map

声明:declare -A  IPHOST

使用: IPHOST[$host]=$ip

5.更改echo 显示效果
iecho()
{
  echo -e  "\033[0;32;1m[INFO] $@ \033[0m"
}

6.rpm 相关用法

rpm -qa | grep 包名     检查依赖包

rpm -e --nodeps --allmatches 删除所有同名包并忽略依赖

 rpm -Uvh --replacefiles --force 

二、本实例主要实现了远程拉取日志,主要通过编写小时拉取日志函数,实现按小时拉取和按天拉取

#!/bin/bash
#shell 中需要的配置文件的目录
source $DIR/../conf/shell_env.conf
#  ${#WORKROOT}获得WORKROOT字符串长度
if [ ${#WORKROOT} -lt 6 ]; then
    exit 1
fi
# $# 获得参数个数 
if [ $# -ne 3 ];then
    exit 1
fi

day=$1
hour=$2
get_log_by_hour=$3
log_name=""

#1.建立日志目录
mkdir -p ${WORKROOT}/log/${day}

#2.根据参数设置
#2-1.按照小时参数
if [ "${get_log_by_hour}" -eq "1" ]; then
    #转换时间格式变成2015_01_02
    log_name=`date -d ${day} +%y_%m_%d`
    log_name=${log_name}_${hour}
#2-2.按照天参数
elif [ "${get_log_by_hour}" -eq "0" ]; then
    log_name=`date -d ${day} +%y_%m_%d`
fi

#3.判断WORKROOT节点日志文件是否存在,存在则删除,防止数据重复
if [ -f ${WORKROOT}/log/${day}/${log_name}.log ];then
	rm -rf ${WORKROOT}/log/${day}/${log_name}.log
fi

#4.按照小时拉取日志function
function getLogsByHour()
{
	log_name_hour=$1
	#1.判断WORKROOT节点一个小时的请求日志文件是否存在,存在则删除,防止数据重复
	if [ -f ${WORKROOT}/log/${day}/${log_name_hour} ];then
		rm -rf ${WORKROOT}/log/${day}/${log_name_hour}
	fi
	#1.拉取所有节点的请求日志 (每小时)
	REQUEST_LOG_HOST=${REQUEST_LOG_HOST//,/ }    #这里是将REQUEST_LOG_HOST中的,替换为空格  
	for req_host in $REQUEST_LOG_HOST
	do
		scp work@${req_host}:${REQUEST_LOG_ROOT}/${log_name_hour}* ${WORKROOT}/log/${day}/${log_name_hour}_bak
		if [ -f ${WORKROOT}/log/${day}/${log_name_hour}_bak ];then
			cat ${WORKROOT}/log/${day}/${log_name_hour}_bak >>  ${WORKROOT}/log/${day}/${log_name_hour}
			rm -rf ${WORKROOT}/log/${day}/${log_name_hour}_bak
			echo "scp log success ${req_host} ${log_name_hour}"
		fi			
	done
}

#5.拉取日志
#5-1.按照小时拉取日志
if [ "${get_log_by_hour}" -eq "1" ]; then
	getLogsByHour ${log_name}.log
elif [ "${get_log_by_hour}" -eq "0" ]; then
#5-2.按照天拉取日志
	#拉取所有节点的请求日志(每天)
    for ((i=0; i<=${hour}; i++))
	do
	  j=${i}
	  if ((i<10))
	  then
	    j="0"${i}
	  fi
	  getLogsByHour ${log_name}_${j}.log
	    #合并所有节点的请求日志(每天)
		if [ -f ${WORKROOT}/log/${day}/${log_name}_${j}.log ]; then
			cat ${WORKROOT}/log/${day}/${log_name}_${j}.log >> ${WORKROOT}/log/${day}/${log_name}.log
			rm -rf ${WORKROOT}/log/${day}/${log_name}_${j}.log
			echo "merge log success ${log_name}_${j}.log to ${log_name}.log"
		fi
	done
fi

 

脚本中有SCRIPT_DIR=“$(cd “$(dirname “${BASH_SOURCE[0]}“)“ && pwd)“,定时任务需要加什么配合使用?、脚本中获取脚本文件所在路径的方式 这行代码是 Bash 脚本中常见的一段,用于确定脚本文件所在的目录,并将其存储在变量 SCRIPT_DIR 中。:这部分代码获取当前执行的脚本文件(即包含这段代码的脚本)的目录路径。BASH_SOURCE[0] 是一个特殊变量,它包含了当前脚本的完整路径。dirname 命令用于从路径中去除文件名,只留下目录路径。:这个命令会改变当前工作目录到 dirname 命令的输出目录。由于这是一个命令替换(command substitution),其输出(即新的目录路径)会被赋值给 SCRIPT_DIR 变量。 阅读详情

相关推荐

【运维】linux shell 编程之函数使用

linux shell 编程关于函数的详细使用

congge_study的博客 1万+

Shell脚本中改变工作目录的命令解析

Shell脚本中改变工作目录的命令解析

Leon_Jinhai_Sun的博客 1011

Xilinx PL端DP显示接口开发实战(一)——环境搭建与硬件选型

本文详细介绍了Xilinx PL端DP显示接口开发的环境搭建与硬件选型实战经验。从Vivado和Vitis 2021.1版本的软件安装要点,到DP141和MCDP6000芯片的选型建议,再到DP1.4接口的RX/TX方向开发关键点,为开发者提供了全面的技术指导。文章还分享了IP核配置、BD原理图设计以及常见问题排查的实用技巧,帮助开发者高效完成Xilinx DP接口开发项目。

weixin_29250573的博客 174

【shell】shell脚本模板和规范

链接:https://www.jianshu.com/p/34c76024c0ef。脚本debug神器,把每一行的脚本执行了什么都打印出来。对应的ini文件(cfg.ini)作者:DayDayUpppppp。使用getopts进行参数解析。

我的笔记本 1746

arduino esp8266_Arduino传感器教程 第22章ESP8266 控制 5V 继电器

ESP8266控制5V继电器目录一、NodeMCU二、工作原理本文将使用亚马逊 AlexaEcho 和 ESP8266 控制 5V 继电器。NodeMCUNodeMCU 是一个开源的 IoT 物联网硬件开发板,由于它支持 WIFI 功能且使用方法十分类似 Arduino 开发板,所以近些年获得了越来越多来自全世界的创客朋友们的青睐。NodeMCU 尺寸与 Arduino Nano 类似。...

weixin_39611722的博客 3456

银河飞腾FT-M6678 DSP开发初体验:从仿真器连接到第一个网络程序(CCS5.5+FT-EMU560实战)

本文详细介绍了银河飞腾FT-M6678 DSP开发环境的搭建过程,包括CCS5.5开发环境的配置、FT-EMU560仿真器的连接与设置,以及关键模块如网络驱动的国产化替换。通过实战案例,帮助开发者快速掌握国产DSP的开发流程,实现网络通信功能。

weixin_30919429的博客 554

shell中如何获取脚本所在的绝对位置(路径)

很简单,就两行代码 :   script_abs=$(readlink -f "$0") script_dir=$(dirname $script_abs) script_dir 就是这个脚本的绝对路径。   至于为什么,大家可去搜索readlink及dirname的用法,最关键的就是readlink的使用,它解决了使用软链接的情况下的定位不准的问题, -f (或者 -m) 也不能少。...

weicn_chen的博客 1万+

华大 HC32F460 DMA数据传输实战:从配置到中断处理的完整指南

本文提供了华大半导体HC32F460微控制器DMA(直接内存访问)功能的完整实战指南。详细解析了DMA的配置流程、中断处理机制以及软件与硬件触发方式,并附有实验代码示例。通过合理使用DMA进行数据传输,可以显著解放CPU资源,提升嵌入式系统的实时性与运行效率。

weixin_29194255的博客 255

__FILE__与__DIR__与 getcwd()与$_SERVER['SCRIPT_FILENAME']之间的区别

要获取当前php脚本所在目录的绝对路径,可以下面通过四个方法: 1、 __FILE__ 2、 __DIR__ 3、getcwd() 4、$_SERVER[‘SCRIPT_FILENAME’]** 下面通过实例来说明之间的区别: 脚本路径:D:\Soft\xampp\htdocs\test\test.php,代码如下:<?php //PHP获取绝对路径方法比较 //__FILE__ vs

水下看花 1078

RustDesk网页端远程控制实战:如何用Web Client替代传统客户端(附安全配置建议)

本文详细介绍了RustDesk网页端远程控制的实战应用,包括其核心优势、配置流程及安全加固方案。通过Web Client替代传统客户端,用户可实现跨平台无缝体验和企业级管理效率,特别适合临时协作和移动设备使用。文章还提供了JWT身份验证、LDAP集成等安全配置建议,确保网页端访问的安全性。

weixin_30836759的博客 253

在运行opencv时出现的两个问题:AttributeError: module ‘cv2‘ has no attribute ‘gapi_wip_gst_GStreamerPipeline‘

解决了opencv的两个问题:由问题一引出 AttributeError: module 'cv2' has no attribute 'gapi_wip_gst_GStreamerPipeline' cv2.error:OpenCV(4.1.2)C:\projects\opencvpython\opencv\modules\highgui\src\window.cpp:717:error: (-2:Unspecified error) The function is not implemented...

hu_yinghui的博客 3275

Shell编程之函数与数组

Shell函数定义或参数$1$n位置参数,$#参数个数,$@所有参数→$1=foo$2=bar返回值return返回状态码(0-255),echo输出结果return 0或局部变量限定函数内作用域Shell数组索引数组,下标从0开始→ "red"关联数组→ "Alice"常用操作${arr[@]}所有元素,${#arr[@]}长度,切片→ "green"遍历done脚本调试调试模式(跟踪执行),set -x(脚本内启用)set -x和set +x包围调试代码块严格模式。

2501_91114776的博客 2261

Python 爬虫实战:微博自动化运营工具(点赞 / 转发 / 评论 + 反封号策略)

微博作为中国最大的社交媒体平台之一,拥有庞大的用户群体和丰富的数据资源。通过 Python 爬虫技术,我们可以实现微博的自动化运营,包括点赞、转发、评论等功能,同时采取有效的反封号策略,确保账号的安全和稳定运行。

u014481728的博客 1178

Shell 编程之函数与数组

在使用函数参数时,函数名称在前参数在后,函数名和参数之间用空格分隔,可以有多个参数,参数使用$1、$2、$3.的方式表示。为避免编写的脚本出错,除了在编写脚本时注意书写规范,排除语法错误,更重要的是利用调试脚本工具来调试脚本。echo 命令是最有用的调试脚本工具之一,一般在可能出现问题的脚本中加入 echo 命令,采用的是分段排查的方式。在 Shell 编程里,数组遍历指的是按顺序访问数组中的每一个元素,并对这些元素执行特定操作的过程这在处理一组相关数据时非常有用,比如批量处理文件、统计数据等。

ASDyushui的博客 1416

【LLC快速上手系列】LLC轻载时:开关频率 + 死区时间 联合优化!

轻载优化,频率别飞天,死区要有耐心。两手一起抓,效率高到笑。😎。

weixin_43199439的博客 1183

win10 跳过U8环境检测的IE WebControls.rar

win10 安装u8的时候 提示IE WebControls 不通过,这个工具可以欺骗u8的检查。 跳过U8环境检测的IE WebControls。提示导入失败后,重新检测通过。

一步步理解Shell编程之函数用法

大家好,今天给大家分享的是shell编程中的函数用法,当然这个函数和数学的函数是不一样的,那么在shell中的函数是什么样的,那么一起来看一下。 1、首先在linux中它有一个命令是:alias 也就是别名的意思,那么这时候我们需要实际操作看看这个alias到底有什么用,如下: 在以上图中我们使用了alias命令 后面跟着N=XXX 那么这个N呢就是一个别名,简单的说,当我们启动Nginx...

延瓒 2129

锂电池充电器电路设计 里面有电路

锂电池充电器电路设计 里面有电路 3.7V升压到5V电路设计。

Shell编程之函数

Shell函数是编写可重用、可维护Shell脚本的重要工具。通过定义和使用函数,我们可以将复杂的任务分解为更小的、更易于管理的部分,并提高代码的可读性和可重用性。在编写Shell脚本时,建议充分利用函数来提高代码的质量和效率。

m0_74860678的博客 1692

深度学习工具包 DeepLearningToolbox

深度学习工具包Deprecation notice.-----This toolbox is outdated and no longer maintained.There are much better tools available for deep learning than this toolbox, e.g. [Theano](http://deeplearning.net/software/theano/), [torch](http://torch.ch/) or [tensorflow](http://www.tensorflow.org/)I would suggest you use one of the tools mentioned above rather than use this toolbox.Best, Rasmus.DeepLearnToolbox================A Matlab toolbox for Deep Learning.Deep Learning is a new subfield of machine learning that focuses on learning deep hierarchical models of data.It is inspired by the human brain's apparent deep (layered, hierarchical) architecture.A good overview of the theory of Deep Learning theory is[Learning Deep Architectures for AI](http://www.iro.umontreal.ca/~bengioy/papers/ftml_book.pdf)For a more informal introduction, see the following videos by Geoffrey Hinton and Andrew Ng.* [The Next Generation of Neural Networks](http://www.youtube.com/watch?v=AyzOUbkUf3M) (Hinton, 2007)* [Recent Developments in Deep Learning](http://www.youtube.com/watch?v=VdIURAu1-aU) (Hinton, 2010)* [Unsupervised Feature Learning and Deep Learning](http://www.youtube.com/watch?v=ZmNOAtZIgIk) (Ng, 2011)If you use this toolbox in your research please cite [Prediction as a candidate for learning deep hierarchical models of data](http://www2.imm.dtu.dk/pubdb/views/publication_details.php?id=6284)```@MASTERSTHESIS\{IMM2012-06284, author = "R. B. Palm", title = "Prediction as a candidate for learning deep hierarchical models of data", year = "2012",}```Contact: rasmusbergpalm at gmail dot comDirectories included in the toolbox-----------------------------------`NN/` - A library for Feedforward Backpropagation Neural Networks`CNN/` - A library for Convolutional Neural Networks`DBN/` - A library for Deep Belief Networks`SAE/` - A library for Stacked Auto-Encoders`CAE/` - A library for Convolutional Auto-Encoders`util/` - Utility functions used by the libraries`data/` - Data used by the examples`tests/` - unit tests to verify toolbox is workingFor references on each library check REFS.mdSetup-----1. Download.2. addpath(genpath('DeepLearnToolbox'));Example: Deep Belief Network---------------------```matlabfunction test_example_DBNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit RBM and visualize its weightsrand('state',0)dbn.sizes = [100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);figure; visualize(dbn.rbm{1}.W'); % Visualize the RBM weights%% ex2 train a 100-100 hidden unit DBN and use its weights to initialize a NNrand('state',0)%train dbndbn.sizes = [100 100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);%unfold dbn to nnnn = dbnunfoldtonn(dbn, 10);nn.activation_function = 'sigm';%train nnopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.10, 'Too big error');```Example: Stacked Auto-Encoders---------------------```matlabfunction test_example_SAEload mnist_uint8;train_x = double(train_x)/255;test_x = double(test_x)/255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit SDAE and use it to initialize a FFNN% Setup and train a stacked denoising autoencoder (SDAE)rand('state',0)sae = saesetup([784 100]);sae.ae{1}.activation_function = 'sigm';sae.ae{1}.learningRate = 1;sae.ae{1}.inputZeroMaskedFraction = 0.5;opts.numepochs = 1;opts.batchsize = 100;sae = saetrain(sae, train_x, opts);visualize(sae.ae{1}.W{1}(:,2:end)')% Use the SDAE to initialize a FFNNnn = nnsetup([784 100 10]);nn.activation_function = 'sigm';nn.learningRate = 1;nn.W{1} = sae.ae{1}.W{1};% Train the FFNNopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.16, 'Too big error');```Example: Convolutional Neural Nets---------------------```matlabfunction test_example_CNNload mnist_uint8;train_x = double(reshape(train_x',28,28,60000))/255;test_x = double(reshape(test_x',28,28,10000))/255;train_y = double(train_y');test_y = double(test_y');%% ex1 Train a 6c-2s-12c-2s Convolutional neural network %will run 1 epoch in about 200 second and get around 11% error. %With 100 epochs you'll get around 1.2% errorrand('state',0)cnn.layers = { struct('type', 'i') %input layer struct('type', 'c', 'outputmaps', 6, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %sub sampling layer struct('type', 'c', 'outputmaps', 12, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %subsampling layer};cnn = cnnsetup(cnn, train_x, train_y);opts.alpha = 1;opts.batchsize = 50;opts.numepochs = 1;cnn = cnntrain(cnn, train_x, train_y, opts);[er, bad] = cnntest(cnn, test_x, test_y);%plot mean squared errorfigure; plot(cnn.rL);assert(er<0.12, 'Too big error');```Example: Neural Networks---------------------```matlabfunction test_example_NNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);% normalize[train_x, mu, sigma] = zscore(train_x);test_x = normalize(test_x, mu, sigma);%% ex1 vanilla neural netrand('state',0)nn = nnsetup([784 100 10]);opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samples[nn, L] = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.08, 'Too big error');%% ex2 neural net with L2 weight decayrand('state',0)nn = nnsetup([784 100 10]);nn.weightPenaltyL2 = 1e-4; % L2 weight decayopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex3 neural net with dropoutrand('state',0)nn = nnsetup([784 100 10]);nn.dropoutFraction = 0.5; % Dropout fraction opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex4 neural net with sigmoid activation functionrand('state',0)nn = nnsetup([784 100 10]);nn.activation_function = 'sigm'; % Sigmoid activation functionnn.learningRate = 1; % Sigm require a lower learning rateopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex5 plotting functionalityrand('state',0)nn = nnsetup([784 20 10]);opts.numepochs = 5; % Number of full sweeps through datann.output = 'softmax'; % use softmax outputopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex6 neural net with sigmoid activation and plotting of validation and training error% split training data into training and validation datavx = train_x(1:10000,:);tx = train_x(10001:end,:);vy = train_y(1:10000,:);ty = train_y(10001:end,:);rand('state',0)nn = nnsetup([784 20 10]); nn.output = 'softmax'; % use softmax outputopts.numepochs = 5; % Number of full sweeps through dataopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, tx, ty, opts, vx, vy); % nntrain takes validation set as last two arguments (optionally)[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');```[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/rasmusbergpalm/deeplearntoolbox/trend.png)](https://bitdeli.com/free "Bitdeli Badge")

shell编程之函数与数组

在 shell 脚本中,数组是一种常见的数据结构,主要的应用场景包括:获取数组长度、获取元素长度、遍历元素、元素切片、元素替换、元素删除等。在 Linux 系统上编写 Shell 脚本的时候,经常需要递归遍历系统的目录,列出目录下的文件和目录,逐层递归列出,并对这些层级关系进行展示。为避免编写的脚本出错,除了在编写脚本时注意书写规范,排除语法错误,更重要的是利用调试脚本工.具来调试脚本。在 shell 编程里,数组遍历指的是按顺序访问数组中的每一个元素,并对这些元素执行特定操作的过程。

king05yh的博客 1388

Linux——Shell编程之函数与数组

所以为了避免自己编写的脚本出错,除了在编写脚本时注意书写规范,排除语法错误,更重要的是利用调试脚本工具来调试脚本。echo命令是最有用的调试脚本工具之一,一般在可能出现问题的脚本中加入echo命令,采用的是分段排查的方式。在Linux上编写Shell脚本的时候,经常需要递归遍历系统的目录,列出目录下的文件和目录,逐层递归列出,并对这些层级关系进行展示。该函数会定期监控系统的CPU和内存使用率,当使用率超过设定的阈值时,就会发送报警信息提醒,这里将简单模拟实验环境,实际的应用中还会扩展为发送邮件、短信等。

Lemon__ing的博客 1684

shell 编程之函数与数组

函数,则是 Shell 脚本中组织代码、提高复用性的关键所在。通过将一系列指令封装成函数,我们可以避免编写大量重复代码,使脚本更加简洁、清晰。函数的定义与调用简洁明了,为 Shell 脚本的模块化开发提供了有力支持。

kgc302的博客 1329

Linux Shell编程之函数与数组

【代码】Linux Shell编程之函数与数组。

2501_91557222的博客 1230
上一篇: kafka及kafka 面试题学习
下一篇: yarn 工作机制原理浅析
date-date
博客等级 码龄9年 6粉丝 28原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值