简体   繁体   English

如何保存shell的输出?

[英]How to save output from the shell?

I want to save this in a file form the shell: 我想将其保存在外壳文件中:

Type the number of steps N
10
Type the initial values ti and ai
0
1
 23.000000 24.000000 
 46.000000 576.000000 
 69.000000 13824.000000 
 92.000000 331776.000000 
 115.000000 7962624.000000 
 138.000000 191102976.000000 
 161.000000 4586471424.000000 
 184.000000 110075314176.000000 
 207.000000 2641807540224.000000 
 230.000000 63403380965376.000000 
 253.000000 1521681143169024.000000 

how to do it? 怎么做? it does not work by just typing: 仅输入以下命令是行不通的:

>./a.out>lalalla.txt

do

script filename.txt

Run the program, then type exit at the prompt 运行程序,然后在提示符下键入exit

The session will be in filename.txt 会话将在filename.txt中

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Shell脚本:如何将循环输出保存到数组 - Shell script: How to save loop output to array 如何从循环保存输出数组? - How do i save my output array from a loop? 在bash shell中使用输出文件中的数组 - Using array from an output file in bash shell 如何将批量文本文件中的选择字符串输出保存到数组Powershell - How to save select-string output from bulk text files to an array powershell 如何在python中将单个列从输入文本文件保存到单个输出文本文件 - how to save individual columns from an input text file to individual output text files in python 如何将sed命令的多行输出保存到数组中? - How to save a multiline output of sed command into array? 如何运行一个 function 两次并保存 output 进行比较? - How to run a function twice and save output for comparison? 如何在Shell脚本中将循环的输出值存储在数组中? - How to store the values of the output of a loop in an array in shell scripting? 如何在 shell 脚本中为以下 json output 创建一个数组? - How to create an array in shell script for the following json output? 如何在Shell脚本中将MySQL查询输出转换为数组形式? - How to convert MySQL query output in array in shell scripting?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM