Forums

Skip to content

Advanced search
  • Quick links
    • Unanswered topics
    • Active topics
    • Search
  • FAQ
  • Login
  • Register
  • Board index Assistance Installing Gentoo
  • Search

what does a "\" specify

Having problems with the Gentoo Handbook? If you're still working your way through it, or just need some info before you start your install, this is the place. All other questions go elsewhere.
Post Reply
Advanced search
8 posts • Page 1 of 1
Author
Message
funboy.ch
n00b
n00b
Posts: 26
Joined: Fri Oct 07, 2005 5:45 pm

what does a "\" specify

  • Quote

Post by funboy.ch » Thu May 25, 2006 7:53 am

Hi folks, new to linux and was wondering what the "\" does in the command below. I'm installing fluxbox on gentoo btw.

# emerge commonbox-styles commonbox-styles-extra \
fluxbox-styles-fluxmod gentoo-artwork


Cheers
Top
Earthwings
Bodhisattva
Bodhisattva
User avatar
Posts: 7753
Joined: Mon Apr 14, 2003 8:13 pm
Location: Germany

  • Quote

Post by Earthwings » Thu May 25, 2006 8:07 am

It indicates that the line should not end there, i.e. the two lines should be interpreted as one line. So

Code: Select all

emerge foo bar
and

Code: Select all

emerge foo \
bar
are the same.

To complete it, the # indicates you have to execute it in a shell logged in as root, while $ normally is used for commands that should be run as normal user.
KDE
Top
funboy.ch
n00b
n00b
Posts: 26
Joined: Fri Oct 07, 2005 5:45 pm

  • Quote

Post by funboy.ch » Thu May 25, 2006 8:13 am

cheers mate, i'm already starting to like linux.

While I'm at it, what do the && do in the line below?

emerge --sync && emerge -u fluxbox


Thanks again, greatly appreciated
Top
troymc
Guru
Guru
Posts: 553
Joined: Wed Mar 22, 2006 8:48 am

  • Quote

Post by troymc » Thu May 25, 2006 8:30 am

The \ is a line continuation symbol.

When \
I type \
something like this.

The shell sees one long line: "When I type something like this."

It's so you can break up long lines into multiple short lines.

&& is a logical AND. When used on the command line like you showed, its effect is to only running the 2nd command if the 1st command completes successfully.

So with that command line, emerge -u fluxbox will only be run if the emerge --sync completes successfully.


FYI, the complement of && is ||. A logical OR. It's effect is to only run the 2nd command when the 1st command fails. So you will often see it used like this:

emerge --sync || echo "ERROR: emerge --sync FAILED!"


troymc
Top
funboy.ch
n00b
n00b
Posts: 26
Joined: Fri Oct 07, 2005 5:45 pm

  • Quote

Post by funboy.ch » Thu May 25, 2006 9:06 am

Wow, thanks alot m8. Really appreciate it.
Top
PsychoticRetina
Guru
Guru
User avatar
Posts: 352
Joined: Sun Dec 18, 2005 10:59 pm
Location: behind the scalpel

  • Quote

Post by PsychoticRetina » Thu May 25, 2006 9:07 am

command 1 && command2 means: run command 1, then run command 2. command 2 will only be run if command 1 finishes succesfully.

command 1 ; command 2 means same as the previous, except command 2 will be executed regardless of whether command 1 is executed succesfully.
there are pinheads everywhere.
penguins are no exception.
Top
asiobob
Veteran
Veteran
User avatar
Posts: 1375
Joined: Wed Oct 29, 2003 8:13 am
Location: Bamboo Creek

  • Quote

Post by asiobob » Fri May 26, 2006 9:56 am

you might also want to read here for introduction to shells by examples
http://www.gentoo.org/doc/en/articles/b ... ple-p1.xml

its for the bash shell which you are probably using
Top
funboy.ch
n00b
n00b
Posts: 26
Joined: Fri Oct 07, 2005 5:45 pm

  • Quote

Post by funboy.ch » Fri May 26, 2006 11:02 am

cheers mate
Top
Post Reply

8 posts • Page 1 of 1

Return to “Installing Gentoo”

Jump to
  • Assistance
  • ↳   News & Announcements
  • ↳   Frequently Asked Questions
  • ↳   Installing Gentoo
  • ↳   Multimedia
  • ↳   Desktop Environments
  • ↳   Networking & Security
  • ↳   Kernel & Hardware
  • ↳   Portage & Programming
  • ↳   Gamers & Players
  • ↳   Other Things Gentoo
  • ↳   Unsupported Software
  • Discussion & Documentation
  • ↳   Documentation, Tips & Tricks
  • ↳   Gentoo Chat
  • ↳   Gentoo Forums Feedback
  • ↳   Duplicate Threads
  • International Gentoo Users
  • ↳   中文 (Chinese)
  • ↳   Dutch
  • ↳   Finnish
  • ↳   French
  • ↳   Deutsches Forum (German)
  • ↳   Diskussionsforum
  • ↳   Deutsche Dokumentation
  • ↳   Greek
  • ↳   Forum italiano (Italian)
  • ↳   Forum di discussione italiano
  • ↳   Risorse italiane (documentazione e tools)
  • ↳   Polskie forum (Polish)
  • ↳   Instalacja i sprzęt
  • ↳   Polish OTW
  • ↳   Portuguese
  • ↳   Documentação, Ferramentas e Dicas
  • ↳   Russian
  • ↳   Scandinavian
  • ↳   Spanish
  • ↳   Other Languages
  • Architectures & Platforms
  • ↳   Gentoo on ARM
  • ↳   Gentoo on PPC
  • ↳   Gentoo on Sparc
  • ↳   Gentoo on Alternative Architectures
  • ↳   Gentoo on AMD64
  • ↳   Gentoo for Mac OS X (Portage for Mac OS X)
  • Board index
  • All times are UTC
  • Delete cookies

© 2001–2026 Gentoo Foundation, Inc.

Powered by phpBB® Forum Software © phpBB Limited

Privacy Policy

 

 

magic