New To Mac-Forums?

Welcome to our community! Join the discussion today by registering your FREE account. If you have any problems with the registration process, please contact us!

Get your questions answered by community gurus Advice and insight from world-class Apple enthusiasts Exclusive access to members-only contests, giveaways and deals

Join today!

 
Start a Discussion
 

Mac-Forums Brief

Subscribe to Mac-Forums Brief to receive special offers from Mac-Forums partners and sponsors

Join the conversation RSS
OS X - Operating System General OS operation information and support

Terminal: stuck in a ">" line


Post Reply New Thread Subscribe

 
Thread Tools
Bmeister1996

 
Member Since: Sep 30, 2012
Posts: 6
Bmeister1996 is on a distinguished road

Bmeister1996 is offline
I've searched the web for an answer to this and all I get is manuals on how to use "VIM." I don't have that nor do I want it. Anyways, when I'm in Terminal typing commands, every now and then I may type something wrong and I'll be put on the next line down preceded by a ">" and am unable to get out of lines starting with ">" even if I hit enter. For a visual example:

Last login: Sun Jun 30 18:22:37 on _______
___________:~ _____$ command command command blah blah
> type something and hit enter
> oh look another line why can't I exit this
> exit
> logout
> oh that didn't work
> etc.


Anywho, I can exit this annoying ">" line by closing the Terminal window, but of course that terminates the running process and makes me retype everything I went through to return to that point. Perhaps there's a hotkey combination I'm unaware of that can exit the ">" lines. Thanks for reading!

-Bmeister
QUOTE Thanks
Bmeister1996

 
Member Since: Sep 30, 2012
Posts: 6
Bmeister1996 is on a distinguished road

Bmeister1996 is offline
DISREGARD MESSAGE ABOVE: ANSWER FOUND

Turns out skimming through other forums on mac-forums led me to a list of shortcuts, which (after trying them all) ONE did the trick!!! Ctrl-d is what I was looking for. Cheers!
QUOTE Thanks
cradom

 
cradom's Avatar
 
Member Since: Feb 14, 2004
Location: Nederland, Texas
Posts: 3,065
cradom has a brilliant futurecradom has a brilliant futurecradom has a brilliant futurecradom has a brilliant futurecradom has a brilliant futurecradom has a brilliant futurecradom has a brilliant futurecradom has a brilliant futurecradom has a brilliant futurecradom has a brilliant future
Mac Specs: 21in iMac core2 Duo- 13in macbook - 10.9 on both

cradom is offline
Just so you know:
CtrlC tells the terminal to send a SIGINT to the current foreground process, which by default translates into terminating the application. CtrlD tells the terminal that it should register a EOF on standard input, which bash interprets as a desire to exit.
Depending on whats happening one or the other should work.
QUOTE Thanks
Raz0rEdge

 
Raz0rEdge's Avatar
 
Member Since: Jul 17, 2009
Location: MA
Posts: 7,472
Raz0rEdge has a brilliant futureRaz0rEdge has a brilliant futureRaz0rEdge has a brilliant futureRaz0rEdge has a brilliant futureRaz0rEdge has a brilliant futureRaz0rEdge has a brilliant futureRaz0rEdge has a brilliant futureRaz0rEdge has a brilliant futureRaz0rEdge has a brilliant futureRaz0rEdge has a brilliant futureRaz0rEdge has a brilliant future
Mac Specs: 27" i7 iMac, 24" iMac, 13" Macbook Air, iPhone 5 & 5S, iPod Nano 7th Gen, iPad 2 16GB WiFi, iPad 3

Raz0rEdge is offline
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
...
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
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
The result of this is:
Code:
$ cat file.txt
This is line one
and line two
and so on

--
Regards
...Ashwin



Be sure to read the Community Guidelines | The more information you provide, the better answers you get, remember GIGO.
QUOTE Thanks

Post Reply New Thread Subscribe


« Automatic wi-fi disabling | bogus cloud storage popup »
Thread Tools

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off
Forum Jump

Similar Threads
Thread
Thread Starter
Forum
Replies
Last Post
Editing the subject line of a received email 4johnwiz OS X - Apps and Games 3 05-28-2013 10:46 PM
White line across the bottom of my screen. rhazen Apple Desktops 5 07-04-2011 07:37 PM
keyboard shortcuts for command line navigation in the terminal steviep OS X - Operating System 4 07-02-2011 05:30 PM
Terminal - Missing command prompt AR3Y35 OS X - Operating System 16 02-09-2009 07:59 AM
another stuck pixel!? code777 Apple Desktops 11 04-14-2005 08:52 AM

All times are GMT -4. The time now is 10:28 PM.

Powered by vBulletin
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
X

Welcome to Mac-Forums.com

Create your username to jump into the discussion!

New members like you have made this community the ultimate source for your Mac since 2003!


(4 digit year)

Already a member?