我需要从某种方面获得原产地——l到——的输出,我可以通过这些产出。
至今为止
cat $1 | ispell -l
我试图按行文将其读成一个阵列,但该团为我工作。
是否有任何建议?
我需要从某种方面获得原产地——l到——的输出,我可以通过这些产出。
至今为止
cat $1 | ispell -l
我试图按行文将其读成一个阵列,但该团为我工作。
是否有任何建议?
这实际上比迄今提供的任何答复要容易得多。 您无需打上任何外部双版,例如<条码>。 或做任何 lo。
简单:
array=( $(ispell -l < $1) )
最新目录有<条码>地图册条码>或<条码>>>> 阅读<>
readarray stuff < <(ispell -l < "$1")
echo "number of lines: ${#stuff[@]}"
(this example returns effectively ispell -l < "$1"|wc -l
)
由于由于管道的缘故,读书会放在一个小星上,所以它赢得了笔工作。 仅使用投入。
mapfile [-n count] [-O origin] [-s count] [-t] [-u fd] [-C callback] [-c quantum] [array]
readarray [-n count] [-O origin] [-s count] [-t] [-u fd] [-C callback] [-c quantum] [array]
Read lines from the standard input into the indexed array variable array, or from file descriptor fd if the -u option is supplied. The vari‐
able MAPFILE is the default array. Options, if supplied, have the following meanings:
-n Copy at most count lines. If count is 0, all lines are copied.
-O Begin assigning to array at index origin. The default index is 0.
-s Discard the first count lines read.
-t Remove a trailing newline from each line read.
-u Read lines from file descriptor fd instead of the standard input.
-C Evaluate callback each time quantum lines are read. The -c option specifies quantum.
-c Specify the number of lines read between each call to callback.
If -C is specified without -c, the default quantum is 5000. When callback is evaluated, it is supplied the index of the next array element
to be assigned as an additional argument. callback is evaluated after the line is read but before the array element is assigned.
If not supplied with an explicit origin, mapfile will clear array before assigning to it.
mapfile returns successfully unless an invalid option or option argument is supplied, array is invalid or unassignable, or if array is not an
indexed array.
There is no such thing as an array in shell. (Bash and zsh have array extensions; but if you find yourself thinking that a bash 或 a zsh extension would be helpful f或 a script, the c或rect choice is instead to rewrite in perl 或 python. /digression)
你们实际上想要的是这些建筑之一:
ispell -l < "$1" | while read line; do
... take action on "$line" ...
done
或
f或 w或d in $(ispell -l < "$1"); do
... take action on "$w或d" ...
done
I would need to know m或e about what you re trying to do and about the output f或mat of ispell -l
(I don t have it installed and don t have time right now to build it) to tell you which of the above is the right option.
#!/bin/bash
declare -a ARRAY_VAR=(`cat $1 | ispell -l`)
for var in ${ARRAY_VAR[@]}
do
place your stuff to loop with ${VAR} here
done
页: 1
ispell -l $file | awk
{
print "Do something with $0"
#Or put to awk array
array[c++]=$0
}
END{
print "processing the array here if you want"
for(i=1;i<=c;i++){
print i,array[i]
}
}
Awk
通过档案进行检索的性能优于批次。
I need to create a simple fixed width text file in KornShell (ksh). My current attempt using printf to pad the string isn t working out very well. What s the shortest, cleanest way to create a fixed ...
how to use the find command to find files/directories which are not matching the pattern. for eg: find <some options > -name "dontfile.txt" should give me output of all the find whose file ...
I need to put the contents of all *.as files in some specified folder into one big file. How can I do it in Linux shell?
How can I check the file encoding in a shell script? I need to know if a file is encoded in utf-8 or iso-8859-1. Thanks
The == operator is used to compare two strings in shell script. However, I want to compare two strings ignoring case, how can it be done? Is there any standard command for this?
I like to write bash shell scripts on my iPhone, put them in an app folder with an icon, plist, etc., so they execute like apps by tapping their icon on SpringBoard. This is not interactive like ...
Whenever I start a shell in vim using :sh, it doesn t source my ~/.bashrc file. How can I get it to do this automatically?
在Windows XP中,没有一时出现指挥时,是否有办法操作一种灰色文字? 我常常需要把“善待”(工作)与“灰色”同起来,即使我的文字没有产出,......