gpt4 book ai didi

unix - shell 命令相当于按键盘上的 Enter 键

转载 作者:行者123 更新时间:2023-12-04 06:38:17 27 4
gpt4 key购买 nike

我想在我的 bash shell 脚本中添加一个 shell 命令,以便在执行该脚本时,它执行的操作相当于按键盘上的 Enter 键,然后执行脚本中的其余命令

例如:script.sh

#! /bin/bash

<command equivalent to pressing enter key>
echo "hi"

尖括号之间应该存在什么,以便输出应该是
$sh script.sh
$
hi
$

最佳答案

在 Windows 上;

echo.
echo hi
echo.

在 Linux 上;
echo
echo hi
echo

关于unix - shell 命令相当于按键盘上的 Enter 键,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4603532/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com