Forums
New posts
Articles
Product Reviews
Policies
FAQ
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Menu
Log in
Register
Install the app
Install
Forums
Apple Computing Products:
macOS - Operating System
Terminal: stuck in a ">" line
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
<blockquote data-quote="Raz0rEdge" data-source="post: 1523812" data-attributes="member: 110816"><p>Bash will give you that symbol if you enter a command that needs multiple arguments to succeed..on the other hand, if you put in the argument that causes the command to kick off, then you won't need to hit CTRL-d to break out of it..</p><p></p><p>For example, if you do</p><p>[CODE]</p><p>$ while [ 1 ];</p><p>> do</p><p>> echo "Hello"</p><p>> sleep 1</p><p>> done</p><p>Hello</p><p>Hello</p><p>Hello</p><p>...</p><p>[/CODE]</p><p></p><p>The 'done' here is the final keyword/argument to the 'while' command to get started, so I immediately start seeing my Hello message showing up one every second.</p><p></p><p>When you use the history (up arrow) to see what command BASH executed, you see</p><p>[CODE]</p><p>while [ 1 ]; do echo "Hello"; sleep 1; done</p><p>[/CODE]</p><p></p><p>On the other hand, a common use of this BASH tactic is to create a new file with something like</p><p>[CODE]</p><p>$ cat > file.txt << EOF</p><p>> This is line one</p><p>> and line two</p><p>> and so on</p><p>> EOF</p><p>[/CODE]</p><p></p><p>The result of this is:</p><p>[CODE]</p><p>$ cat file.txt</p><p>This is line one</p><p>and line two</p><p>and so on</p><p>[/CODE]</p></blockquote><p></p>
[QUOTE="Raz0rEdge, post: 1523812, member: 110816"] Bash will give you that symbol if you enter a command that needs multiple arguments to succeed..on the other hand, if you put in the argument that causes the command to kick off, then you won't need to hit CTRL-d to break out of it.. For example, if you do [CODE] $ while [ 1 ]; > do > echo "Hello" > sleep 1 > done Hello Hello Hello ... [/CODE] The 'done' here is the final keyword/argument to the 'while' command to get started, so I immediately start seeing my Hello message showing up one every second. When you use the history (up arrow) to see what command BASH executed, you see [CODE] while [ 1 ]; do echo "Hello"; sleep 1; done [/CODE] On the other hand, a common use of this BASH tactic is to create a new file with something like [CODE] $ cat > file.txt << EOF > This is line one > and line two > and so on > EOF [/CODE] The result of this is: [CODE] $ cat file.txt This is line one and line two and so on [/CODE] [/QUOTE]
Verification
Name this item 🌈
Post reply
Forums
Apple Computing Products:
macOS - Operating System
Terminal: stuck in a ">" line
Top