我的名字是路易斯,住在arg.我有一个问题,这是无法解决的.
**IN BASH**
pwd
/home/labs-perl
ls
file1.pl file2.pl
**IN PERL**
my $ls = exec("ls");
my @lsarray = split(/\s+/, $ls);
print "$lsarray[1]\n"; #how this, i need the solution. >> file.pl
file1.pl file2.pl # but this is see in shell.
Run Code Online (Sandbox Code Playgroud) 这是python中IDLE2中的代码和错误.
我需要以有序的方式将每个"data"元素作为键和值"otro"包含在内.那么"数据"和"otro"就是38个字符串的列表,"dik"就是字典.
>>> for i in range(len(otro)+1):
dik[dato[i]] = otro[i]
Traceback (most recent call last):
File "<pyshell#206>", line 2, in <module>
dik[dato[i]] = otro[i]
IndexError: list index out of range
>>>
Run Code Online (Sandbox Code Playgroud)
这个问题是范围(0,38)输出 - >(0,1,2,3 ... 37)并且它都是凌乱的
我需要更改HTML文件的价格,它会搜索并将它们存储在数组中,但我必须更改并保存/nuevo-focus.html
price=( `cat /home/delkav/info-sitioweb/html/productos/autos/nuevo-focus.html | grep -oiE '([$][0-9.]{1,7})'|tr '\n' ' '` )
price2=( $90.880 $0 $920 $925 $930 $910 $800 $712 $27.220 $962 )
sub (){
for item in "${price[@]}"; do
for x in ${price2[@]}; do
sed s/$item/$x/g > /home/delkav/info-sitioweb/html/productos/autos/nuevo-focus.html
done
done
}
sub
Run Code Online (Sandbox Code Playgroud)
输出"cat /home/.../nuevo-focus.html|grep -oiE'([$] [0-9.] {1,7})'| tr'\n'''`)"是...
$86.880 $0 $912 $908 $902 $897 $882 $812 $25.725 $715
Run Code Online (Sandbox Code Playgroud)