我有一个复杂的命令,我想制作一个shell/bash脚本.我可以$1
轻松地写出来:
foo $1 args -o $1.ext
Run Code Online (Sandbox Code Playgroud)
我希望能够将多个输入名称传递给脚本.什么是正确的方法呢?
当然,我想处理其中包含空格的文件名.
我的学生编写了这个简单的程序,它调用 system 来处理一些文件,但由于某种原因,它在不应该转义 * 元字符时进行了转义。
#!/opt/anaconda3/bin/perl
# catfastq.pl
# the following 'use' just makes the script print warnings and controles variable scoping (i.e. I have to place 'my' before a new variable declaration)
use warnings;
use strict;
# define array of letters that you will use in the file names
my @letter = ('A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'X', 'Z');
# store full path …
Run Code Online (Sandbox Code Playgroud)