reading input to shell

!/bin/bash

echo "Please type a word!"
read word

echo "You just typed $word"

echo "Please type two words!"
read word1 word2

echo "You just typed $word1 $word2"

[jerry@localhost bin]$ ./reply_test.sh
./reply_test.sh: line 1: !/bin/bash: No such file or directory
Please type a word!
word
You just typed word
Please type two words!
word1 word2
You just typed word1 word2


来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/23895263/viewspace-697718/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/23895263/viewspace-697718/

PHP文件包含漏洞与伪协议利用:从原理到实战防御 文件包含是Web开发中常见的代码复用机制,其核心原理是通过include或require语句将外部文件引入当前脚本执行。当开发者未对用户输入的文件路径进行严格校验时,攻击者可通过操控路径参数实现本地或远程文件包含,从而引发安全漏洞。该漏洞的技术价值在于其能够绕过常规文件上传限制,直接读取服务器敏感文件(如配置文件、系统文件)甚至执行任意代码,在渗透测试中常作为突破口。PHP伪协议作为内置的流包装器,为攻击者提供了强大的利用工具,例如php://filter可绕过执行直接读取源码,php://input在特定 阅读详情

相关推荐

科技中介服务机构如何提升客户在技术评估与需求匹配环节的服务效率与专业度.docx

科技中介服务机构如何提升客户在技术评估与需求匹配环节的服务效率与专业度

【Tessent】【Workflows】Tessent Shell Flow for Hierarchical Designs

Hierarchical DFT

Tranquil_ovo的博客 2941

Windows 11任务管理器隐藏技能:一眼揪出内存泄漏的“元凶”(分页/非分页缓冲池详解)

本文详细介绍了Windows 11任务管理器中隐藏的分页缓冲池和非分页缓冲池功能,帮助用户精准定位内存泄漏问题。通过启用隐藏列、解读数据异常信号,并结合实战案例和高级工具推荐,为开发者和IT运维人员提供了高效的内存问题诊断与解决方案。

weixin_29284885的博客 628

Python stdin读取全解析:从input到sys.stdin的4种方式

stdin(标准输入)是Python与外部数据交互的基础I/O通道,本质是遵循文件协议的系统级数据流入接口。其核心原理在于操作系统为进程预置的文件描述符0,行为受运行上下文(终端/管道/重定向)动态支配。技术价值体现在轻量交互、流式处理和Unix工具链集成能力上。典型应用场景包括命令行工具开发、日志实时分析、CI/CD脚本自动化及Kubernetes Init Container配置注入。本文深入剖析input()、sys.stdin.read()、sys.stdin.readline()和sys.stdi

weixin_30271335的博客 573

BurpSuite+安卓模拟器双保险:避开真机抓包限制的完整配置指南

本文详细介绍了如何通过BurpSuite与安卓模拟器(如雷电、夜神)协同工作,绕过真机抓包限制的完整配置指南。从环境准备、网络拓扑配置到证书部署和流量分析,提供了一套高效的解决方案,帮助安全测试人员稳定捕获手机数据包,提升测试效率。

Apple的专栏 439

Aspice的理解

ASPICE 是由汽车行业的主要公司和组织合作开发的,包括德国汽车工业联合会(VDA)和国际汽车工作组(Automotive SIG)。其目标是通过标准化的软件开发流程,提高汽车电子系统的软件质量和可靠性。

hkj8808的博客 2015

多进程中错误 EOFError: EOF when reading a line

from multiprocessing import Process def func(): num = input('>>>') print(num) if __name__ == '__main__': Process(target=func).start() 在子进程中不能有输入,会报错

陈宸的博客 6292

从DWS到设备树:MTK平台LK阶段GPIO初始化的隐秘路径与调试实战

本文深入探讨了MTK平台LK阶段GPIO初始化的完整流程,揭示了从DWS配置到设备树生成的隐秘转换路径。通过分析MT6768等平台的启动框架,提供了针对preloader到LK阶段GPIO初始化异常的实战调试方法与最佳实践,帮助开发者有效解决硬件与软件配置不匹配的常见问题。

h9j8k7l6m5n的博客 1003

Emacs python-mode下奇怪的EOFError: EOF when reading a line问题

Emacs有一个python-mode,使得编写python程序非常方便,但是却因为集成在emacs编辑器里,会出一些直接在shell下没有的问题。比如有这么一段python程序:#!/usr/bin/python str = raw_input("Prompt:") bash下直接运行没有问题:cheryl@debian:~$ python test_input.py Prompt:It works on bash now! cheryl@debian:~$  但是在Emacs里使用py-exec

雨婷的专栏 6241

江科大51单片机笔记【1】单片机及开发板介绍

单片机,Micro Controller Unit,简称MCU,内部集成了CPU、RAM、ROM、定时器、中断系统、通讯接口等一系列电脑的常用硬件功能单片机的任务是信息采集(传感器)、处理(CPU)和硬件设备(电机、LED)的控制单片机算是一个袖珍版计算机,是一个完整的计算机系统,成本低体积小结构简单单片机的使用领域:智能仪表、实时工控、通讯设备、导航系统、家用电器等。

2301_80195807的博客 835

OpenEvidence DeepConsult深度分析:技术架构、临床应用与行业影响

摘要:医疗AI平台OpenEvidence通过多智能体协作系统重构临床决策流程,解决了医学信息过载难题。其DeepConsult系统严格基于同行评审文献,5-10秒内提供循证决策支持,已覆盖40%美国医生,月咨询量达850万次。该平台采用"免费工具+广告变现"模式,通过调度、检索、摘要等模块化智能体分工,实现从文献分析到临床建议的闭环处理,在USMLE测试中准确率达90%。2025年获7500万美元融资后估值突破10亿美元,成为医疗AI领域的新范式。

AllenLV的博客 2556

shell在指定目录下执行nohup_求救:ubuntu系统下 shell脚本单独执行没为题,但nohup执行就会...

该楼层疑似违规已被系统折叠隐藏此楼查看此楼求救:ubuntu系统下,我的shell脚本read_ini.sh如下!/bin/bash# __readINI [配置文件路径+名称] [节点名] [键值]function __readINI {INIFILE=$1; SECTION=$2; ITEM=$3#_readIni=`awk -F '=' '/\['$SECTION'\]/{a=1}a==1...

weixin_39929877的博客 334

R语言下载包报错?可能是IE浏览器在搞鬼!手把手教你修复(附CRAN镜像选择指南)

本文深入解析了R语言下载包时常见的网络报错问题,特别是Windows系统中因Internet Explorer代理设置导致的连接失败。文章提供了从重置IE配置、排查防火墙到优化CRAN镜像选择的完整解决方案,并附有详细的配置指南和自动化诊断脚本,帮助用户彻底解决R包安装难题。

weixin_29056781的博客 743

RV1106 Linux GPIO控制全攻略:从Shell命令到C程序实现

GPIO(通用输入输出)是嵌入式Linux开发中最基础的外设接口,它通过简单的电平控制实现硬件交互。其原理基于Linux内核的GPIO子系统,通过虚拟文件系统(sysfs)为用户空间提供统一的操作接口。掌握GPIO控制技术对于嵌入式设备开发具有重要价值,它不仅是驱动硬件(如LED、按键)的基础,也是理解Linux硬件抽象层的关键。在应用场景上,GPIO广泛用于设备状态指示、传感器数据采集和外围设备控制等。本文以RV1106开发板为例,详细讲解通过Shell命令和C语言程序两种方式操作GPIO的完整流程,涵盖

WGH100817的博客 381

【Linux】Windows11 安装 WSL2 并运行 Ubuntu 22.04 详细操作步骤

Windows 11 安装 WSL2 和 Ubuntu 22.04 指南 本文详细介绍在 Windows 11 上安装 WSL2 和 Ubuntu 22.04 的完整步骤,包括: WSL2 与 VirtualBox 的性能对比优势 系统版本检查与升级方法 两种安装方式(一键安装和手动安装) Ubuntu 22.04 的安装与配置 存储位置管理及迁移技巧 常用 WSL2 命令速查表 文章还提供了性能优化建议和常见问题解决方案,适合开发者和 Linux 爱好者快速搭建高效的开发环境。

No8g攻城狮的博客 2万+

深度学习工具包 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与Unix系统环境下的核心自动化工具,其本质是一种命令解释器脚本语言,通过调用系统命令和程序,将一系列手动操作流程固化为可重复执行的自动化任务。其技术价值在于极大地提升了系统管理、数据处理和任务调度的效率,是连接操作系统与应用层的关键“胶水”。在应用场景上,Shell脚本广泛应用于服务器运维自动化、日志分析处理、CI/CD流水线任务、批量文件操作以及系统监控告警等日常工程实践。本文聚焦于Shell脚本编程实战,系统讲解从变量定义、流程控制到函数封装的核心语法,并深入剖析文本处理“三

weixin_33985507的博客 453

lwip-2.0.3

lwip是瑞典计算机科学院(SICS)的Adam Dunkels 开发的一个小型开源的TCP/IP协议栈。实现的重点是在保持TCP协议主要功能的基础上减少对RAM 的占用。

ThinkRail Web UI 术语规范:从 App Shell 到 Chat View 的界面词汇表与实现锚点

本文基于 [apps/web/UI-TERMINOLOGY.md](https://link.gitcode.com/i/9ac144935d2a0cb81be3d70a58d9a062) 整理,系统讲解 ThinkRail Web UI(`apps/web`)的官方界面术语体系:App Shell、Top Bar、Projects Tool、Center Workbench、Chat View、

gitblog_00556的博客 394

IDEA的使用指南

IDEA基于java的使用手册,可以最快速的上手,在使用中不断的丰富自己的使用技巧.

SIMATIC S7-1200, S7-1500 PID 控制[手册]

SIMATIC S7-1200, S7-1500 PID 控制[手册]

Bash 防御式编程实战指南:基于 agentic-awesome-skills 仓库的可靠 Shell 脚本模式

在 agentic-awesome-skills 仓库中,从 `scripts/` 下的激活与校验脚本到各技能目录的辅助脚本,处处可见防御式 Bash 编程的实践。本指南以技能 `bash-defensive-patterns` 的[实施手册](https://pre-link.gitcode.com/i/380a72da8759211796fca2418a616a4f)为骨架,结合仓库内真实脚本

gitblog_00246的博客 19

边缘计算设备UPS监控实战:基于NUT在Jetson Orin NX上实现电力状态感知与自动控制

不间断电源(UPS)是保障服务器和边缘计算设备在电力异常时稳定运行的关键基础设施。其核心原理是在市电中断或异常时,通过内置电池无缝供电,防止数据丢失和硬件损坏。在工业物联网和边缘计算场景中,实现UPS状态的实时监控与自动控制,对于保障关键业务连续性具有重要技术价值。通过开源工具NUT(Network UPS Tools),可以构建一套通用的UPS监控与管理方案,它支持多种品牌UPS,并通过驱动层、服务层和客户端层的清晰架构,提供状态查询、事件监控和自动关机等功能。本文将结合在NVIDIA Jetson Or

weixin_34393428的博客 344

AtomicParsley命令速查表:20+常用参数让MP4标签编辑效率提升300%

AtomicParsley是一款轻量级命令行工具,专为读取、解析和设置MPEG-4文件元数据而设计,尤其适用于iTunes风格的 metadata 编辑。通过本文介绍的20+常用参数,你可以轻松实现对MP4文件标签的高效管理,让媒体文件组织更有序。 ## 基础功能参数 ⚙️ ### 查看文件信息 使用`--print`参数可以将MP4文件的XML元数据显示到屏幕上,快速了解文件当前的标签信息:

gitblog_00426的博客 742

JC Shell:嵌入SSH协议的AI Agent终端框架

SSH不仅是远程连接协议,更是基础设施自动化的核心入口。理解其底层字节流交互原理,是实现智能运维的前提;而AI Agent的真正价值,在于事件驱动、上下文感知、离线可执行的自动化能力——它不依赖云端大模型,而是通过WASM沙箱在协议层实时响应连接成功、命令输出、认证失败等关键事件。这种深度集成赋予终端环境自主决策力,广泛应用于边缘设备批量运维、Kubernetes节点自愈、跨平台密钥统一治理等高可靠性场景。JC Shell正是这一理念的工程化落地。

weixin_33910385的博客 311

OS之子进程简单模拟shell解释环境

(1)每次主进程在接收指令进行解释之前,调用waitpid(-1,NULL, WNOHANG);释放可能存在的执行完毕的子进程资源(不会等待); (2)当输入一条指令后,将指令拆分成独立的符号; (3)如果指令的最后一个符号是’&’,则(5)子进程执行指令的时候,父进程将不会wait()子进程执行完毕,继续接收下一条指令进行解释; (4)History指令由主程序使用循环队列进行维护,最多只

qq123386926的专栏 628

Korn Shell Notes(V)

 19. Input/Output Commands19.1 Escape CharactersThe /c escape character causes the trailing newline to be dropped from the output. It is often used to create prompts.    $ print "Enter choice: /c"    

Bo Yang's Blog 819

adb 常用命令汇总

本文汇总 Android 开发高频 ADB 命令,覆盖设备连接、应用安装卸载、日志抓取、文件传输、Shell 调试与常见排错。每类命令按“场景—命令—注意事项”整理,便于快速检索与实战使用,减少查文档和试错成本。适合开发、测试与运维同学作为日常调试速查手册长期收藏。

帅次的博客 5万+

Unity Android log view(Android Debug Bridge)

Android Debug Bridge

蛰伏--当你不够强大时,就不要放弃努力 4159

DVWA文件包含漏洞实战:从原理到GetShell的完整攻防演练

文件包含漏洞是Web安全中一种常见的代码注入漏洞,其核心原理在于应用程序动态包含文件时,未对用户输入进行严格过滤,导致攻击者可以包含并执行任意文件。从技术价值看,这类漏洞危害极大,可直接导致敏感信息泄露、远程代码执行,甚至获取服务器权限。在应用场景上,它常出现在使用PHP等脚本语言开发的Web应用中,尤其是在配置不当(如allow_url_include开启)或编码不严(如未使用白名单)的情况下。本文聚焦于文件包含漏洞的实战利用,通过DVWA靶场环境,详细演示了如何利用本地文件包含(LFI)读取系统敏感文件

weixin_30675247的博客 280
上一篇: xecuting shell commands with bash
下一篇: bash trap
cuiting4706
博客等级 码龄11年 0粉丝 0原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符  | 博主筛选后可见
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

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

抵扣说明:

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

余额充值