如何从文件中读取perl脚本的输入? [英] how to read inputs from file for perl script?

查看:72
本文介绍了如何从文件中读取perl脚本的输入?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在运行我的perl脚本

" perl script.pl / root / sample / shadow .htpasswd"

现在我需要将这些输入单独传递文件

并从该文件中读取。


例如

文件内容可能是

/ root / sample / shadow .htpasswd

/ root / sample / shadow .htpasswd1

/ root / sample / shadow .htpasswd2

/ root / sample / shadow .htpasswd3


和我的脚本用于比较上面列出的两个文件。

解决方案

我不知道理解你的问题


如果你想比较两个文件,你可以将两个/多个文件的路径作为参数发送到直接用空格分隔的脚本:

展开 | 选择 | Wrap < span class =codeDivider> | 行号



如果您要比较两个文件,可以将两个/多个文件的路径作为参数发送到由空格直接分隔的脚本:

展开 | 选择 | Wrap | 行号< /跨度>

i am running my perl script as
"perl script.pl /root/sample/shadow .htpasswd"
now i need to pass these inputs in separate file
and read from that file.

for eg
content of file may be
/root/sample/shadow .htpasswd
/root/sample/shadow .htpasswd1
/root/sample/shadow .htpasswd2
/root/sample/shadow .htpasswd3

and my script is for comparing two files listed above.

解决方案

I don''t understand your question


If you are trying to compare two files, you can send the path of two/more files as arguments to the script separated by space directly :

Expand|Select|Wrap|Line Numbers


If you are trying to compare two files, you can send the path of two/more files as arguments to the script separated by space directly :

Expand|Select|Wrap|Line Numbers


这篇关于如何从文件中读取perl脚本的输入?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆