shell - 将整个文件读入 C-Shell (csh) 脚本中的变量

标签 shell csh

我需要将整个文本文件读入一个 shell 变量。已经有关于此的另一个线程,但它只给出了 sh 和 bash 的示例:

How to read a file into a variable in shell?

我如何在 csh 中做到这一点?

很抱歉开始一个新线程,但我是这个网站的新手,无法发表评论。如果你不能一开始就发表评论,你应该如何建立自己的声誉?

最佳答案

您可以使用

set value=`cat myfile`

关于shell - 将整个文件读入 C-Shell (csh) 脚本中的变量,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39431088/

相关文章:

c - 一个跟踪 CPU 时间和内存使用情况的 Linux shell

bash - csh/sh for loop - 怎么做?

linux - 在cshrc中执行别名

linux - 在 csh 中运行 unix ksh 命令

linux - 如何在shell脚本中调用./etc/bash_completion?

linux - 历史和剪切命令 : get the second field

linux - 按分钟聚合文件中的行

linux - 为什么/usr/bin/timeout 会杀死整个管道?

linux - csh 内联数学

unix - 如何从 tcl 脚本运行 csh 脚本?