首页 \ 问答 \ 如何将结果存储到HP OpenVMS DCL中的变量中?(How to store a result to a variable in HP OpenVMS DCL?)

如何将结果存储到HP OpenVMS DCL中的变量中?(How to store a result to a variable in HP OpenVMS DCL?)

我想将程序的输出保存到变量中。

我使用以下方法,但失败。

$ PIPE RUN TEST | DEFINE/JOB VALUE @SYS$PIPE $ x = f$logical("VALUE")

我得到一个错误: %DCL-W-MAXPARM, too many parameters - reenter command with fewer parameters \WORLD\

参考: 如何将程序的输出分配给VMS上的DCL com脚本中的变量?


I want to save the output of a program to a variable.

I use the following approach ,but fail.

$ PIPE RUN TEST | DEFINE/JOB VALUE @SYS$PIPE $ x = f$logical("VALUE")

I got an error:%DCL-W-MAXPARM, too many parameters - reenter command with fewer parameters \WORLD\

reference : How to assign the output of a program to a variable in a DCL com script on VMS?


原文:https://stackoverflow.com/questions/34890693
更新时间:2021-08-20 08:08

最满意答案

喜欢这个

ghci> import Data.Char
ghci> import Data.List
ghci> groupBy (const isAlphaNum) "A bunch of words and numbers34"
["A"," bunch"," of"," words"," and"," numbers34"]

要么

ghci> groupBy (const isAlpha) "A bunch of words and numbers34"
["A"," bunch"," of"," words"," and"," numbers","3","4"]

编辑:由于没有迹象表明解决方案已被发现的扩展问题,为了保持标准的SO我将完成问题的答案:

import Data.List

isVowel :: Char -> Bool
isVowel c = c `elem` "aeiouy"

bothVowelConsonant :: Char -> Char -> Bool
bothVowelConsonant a b = all isVowel [a,b] || not (any isVowel [a,b])

splitByVowel :: String -> [String]
splitByVowel s = groupBy bothVowelConsonant s

Like this

ghci> import Data.Char
ghci> import Data.List
ghci> groupBy (const isAlphaNum) "A bunch of words and numbers34"
["A"," bunch"," of"," words"," and"," numbers34"]

Or

ghci> groupBy (const isAlpha) "A bunch of words and numbers34"
["A"," bunch"," of"," words"," and"," numbers","3","4"]

Edit: Since there has been no indication that a solution has been found to the extended problem, in the interest of keeping up the standard of SO I shall complete the answer to the problem:

import Data.List

isVowel :: Char -> Bool
isVowel c = c `elem` "aeiouy"

bothVowelConsonant :: Char -> Char -> Bool
bothVowelConsonant a b = all isVowel [a,b] || not (any isVowel [a,b])

splitByVowel :: String -> [String]
splitByVowel s = groupBy bothVowelConsonant s

相关问答

更多
  • 但在上面的第二个示例中,它将每个元素的列表分开,但谓词应该计算为False 。 在第二个例子中,它也评估每两个连续的元素。 它的工作const isAlphaNum是const isAlphaNum 。 这意味着这种类型是: const isAlphaNum :: b -> Char -> Bool 它因此调用组的开始和元素的函数,但它只考虑第二个元素 。 因此,如果我们用groupBy (const isAlphaNum) "split this"调用它,它将评估: succs 2nd con ...
  • 它作为高阶函数 (函数作为参数的函数)的参数很有用,您希望某些特定值保持不变。 示例1 :如果它位于Just中,则单独留下一个值,否则返回默认值7。 Prelude Data.Maybe> :t maybe maybe :: b -> (a -> b) -> Maybe a -> b Prelude Data.Maybe> maybe 7 id (Just 2) 2 示例2 :通过折叠构建函数: Prelude Data.Maybe> :t foldr (.) id [(+2), (*7)] :: (N ...
  • 您需要为它提供一个函数 ,更具体地说,是一个endofunction (将任何类型映射到自身)。 例如, *Main> iter 3 sqrt 256 2.0 当然,这也可以是自定义功能 *Main> let f x = x+2 *Main> iter 3 f 7 13 甚至是在调用中定义的匿名的: *Main> iter 3 (\str -> "("++str++")") "..." "(((...)))" You need to give it a function, more specifica ...
  • zipWith在两个列表的每个成员上成对调用给定的函数。 所以zipWith f [a,b,c] [x,y,z]计算结果为[fax, fby, fcz] 。 在这种情况下, f是zipWith (*)并且列表中的元素也是列表,因此您可以: [ zipWith (*) [1,2,3] [3,2,2], zipWith (*) [3,5,6] [3,4,5], zipWith (*) [2,3,4] [5,4,3] ] 现在, zipWith的内部调用将内部列表的元素成对地相乘,因此您可以: [ [ ...
  • 喜欢这个 ghci> import Data.Char ghci> import Data.List ghci> groupBy (const isAlphaNum) "A bunch of words and numbers34" ["A"," bunch"," of"," words"," and"," numbers34"] 要么 ghci> groupBy (const isAlpha) "A bunch of words and numbers34" ["A"," bunch"," of"," ...
  • 好的 - 你不知何故必须带着你的标志 ,所以显而易见的解决方案是用一个参数来做(然后添加一个版本来修复第一个调用的这个参数): alternateSum' :: Num a => a -> [a] -> a alternateSum' _ [] = 0 alternateSum' f (h:tl) = f * h + alternateSum' (-f) tl alternateSum :: [Integer] -> Integer alternateSum ns = alternateSum' ...
  • 我们有: applyTwice f x = f(f x) 这只有在x和fx的类型是等价的时候才有意义(否则你怎么能够将fx传递给带x的函数?)。 因此,可以说applyTwice需要2个输入参数: 采用类型t并返回相同类型t的函数 某种类型的输入 现在这个输入可以是任何类型,比如t1。 但是你也必须能够把这个函数应用到这个输入中,所以输入的类型也必须是t。 放在一起,我们得到签名: applyTwice :: (t -> t) -> t -> t 请记住,只有最后一个词是返回类型,而其他所有词都是输入类 ...
  • head返回列表的第一个元素。 在这种情况下,它返回列表tail integerList的第一个元素。 tail返回没有第一个元素的原始列表。 原始列表是integerList ,它绑定到[1] ++ integerList 。 ++运算符连接两个列表,因此结果列表为1 : integerList 。 将tail应用于此列表会产生integerList ,因此tail integerList只会产生integerList 。 回到开头:用integerList替换tail integerList (因为这就 ...
  • 教会数字算法往往涉及相当奇怪的类型,因此它在Haskell中并不像在无类型语言中那样优雅。 原则上,教会数字是一种功能,它接受任何内同态并在同一类型上给出另一种内同态,即 five :: (a -> a) -> a -> a 适用于任何类型a ,即它真正意味着 {-# LANGUAGE ExplicitForall, UnicodeSyntax #-} five :: ∀ a . (a -> a) -> a -> a 当你用这样的数字做有趣的算术时,技巧是计算的各个组成部分实际上可能正在处理不同类型的内 ...
  • groupBy :: (a -> a -> Bool) -> [a] -> [[a]]使用组的第一个成员作为参考。 所以,如果你写: groupBy eq (x:x2:x3) 它将 - 如果满足eq x x2 ,则调用eq x x3以检查x3也属于同一组。 所以电话是: arg1 | arg2 | (>) `on` (*1) -5 | -4 | False -4 | 5 | False 5 | 4 | True 5 | -2 | True 5 | -3 | ...

相关文章

更多

最新问答

更多
  • 您如何使用git diff文件,并将其应用于同一存储库的副本的本地分支?(How do you take a git diff file, and apply it to a local branch that is a copy of the same repository?)
  • 将长浮点值剪切为2个小数点并复制到字符数组(Cut Long Float Value to 2 decimal points and copy to Character Array)
  • OctoberCMS侧边栏不呈现(OctoberCMS Sidebar not rendering)
  • 页面加载后对象是否有资格进行垃圾回收?(Are objects eligible for garbage collection after the page loads?)
  • codeigniter中的语言不能按预期工作(language in codeigniter doesn' t work as expected)
  • 在计算机拍照在哪里进入
  • 使用cin.get()从c ++中的输入流中丢弃不需要的字符(Using cin.get() to discard unwanted characters from the input stream in c++)
  • No for循环将在for循环中运行。(No for loop will run inside for loop. Testing for primes)
  • 单页应用程序:页面重新加载(Single Page Application: page reload)
  • 在循环中选择具有相似模式的列名称(Selecting Column Name With Similar Pattern in a Loop)
  • System.StackOverflow错误(System.StackOverflow error)
  • KnockoutJS未在嵌套模板上应用beforeRemove和afterAdd(KnockoutJS not applying beforeRemove and afterAdd on nested templates)
  • 散列包括方法和/或嵌套属性(Hash include methods and/or nested attributes)
  • android - 如何避免使用Samsung RFS文件系统延迟/冻结?(android - how to avoid lag/freezes with Samsung RFS filesystem?)
  • TensorFlow:基于索引列表创建新张量(TensorFlow: Create a new tensor based on list of indices)
  • 企业安全培训的各项内容
  • 错误:RPC失败;(error: RPC failed; curl transfer closed with outstanding read data remaining)
  • C#类名中允许哪些字符?(What characters are allowed in C# class name?)
  • NumPy:将int64值存储在np.array中并使用dtype float64并将其转换回整数是否安全?(NumPy: Is it safe to store an int64 value in an np.array with dtype float64 and later convert it back to integer?)
  • 注销后如何隐藏导航portlet?(How to hide navigation portlet after logout?)
  • 将多个行和可变行移动到列(moving multiple and variable rows to columns)
  • 提交表单时忽略基础href,而不使用Javascript(ignore base href when submitting form, without using Javascript)
  • 对setOnInfoWindowClickListener的意图(Intent on setOnInfoWindowClickListener)
  • Angular $资源不会改变方法(Angular $resource doesn't change method)
  • 在Angular 5中不是一个函数(is not a function in Angular 5)
  • 如何配置Composite C1以将.m和桌面作为同一站点提供服务(How to configure Composite C1 to serve .m and desktop as the same site)
  • 不适用:悬停在悬停时:在元素之前[复制](Don't apply :hover when hovering on :before element [duplicate])
  • 常见的python rpc和cli接口(Common python rpc and cli interface)
  • Mysql DB单个字段匹配多个其他字段(Mysql DB single field matching to multiple other fields)
  • 产品页面上的Magento Up出售对齐问题(Magento Up sell alignment issue on the products page)