简体   繁体   English

隐藏Bash输出中的“目录和Bash目录”

[英]Hide the “Directory and Bash Directory” from Bash Output

When I run my bash script the beginning output is this: 当我运行bash脚本时,开始的输出是这样的:

    Ryans-MacBook-Air:~ Ryan-Macintosh$ /Users/Ryan-Macintosh/Desktop/bash.sh ; exit; 

I want to hide that part from the output when I start my Bash program, is there any way to do this? 当我启动Bash程序时,我想从输出中隐藏该部分,有什么办法吗? Here is my full bash program below: 这是我下面完整的bash程序:

    #! /bin/bash 
    export PS1=""
    echo "HUGE BLOCK OF TEXT HERE THAT IS TOO LONG TO PASTE"
    $SHELL

So in other words I just want my script to show the big block of text from echo, and nothing else. 所以换句话说,我只希望我的脚本显示回显中的大部分文本,而没有其他内容。

That does not appear to be the output of your bash script, it's the current state of the screen. 这似乎不是您的bash脚本的输出,而是屏幕的当前状态。 You could begin your script with a clear (or a reset ). 您可以以clear (或reset )开头脚本。

#!/usr/bin/env bash 
clear # Clear (or reset) the screen
echo "HUGE BLOCK OF TEXT HERE THAT IS TOO LONG TO PASTE"
$SHELL # What is $SHELL?

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM