./configure backslash questions


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers ./configure backslash questions
# 1  
Old 04-28-2009
./configure backslash questions

Hello all. I am going to try my hand at compiling tarballs rather than installing packages.

I have a pretty good understanding of the process and have even compiled/installed Top from source.

But that was an easy install, I want to try something more complex using the various configure flags.

From what I have read, you can specify a number of options with the flags. From my reading, I often see a flag followed by a backslash ("\").

What I am wondering, are there any special rules with regards to the use of these backslashes? IE: single space after the flag and then the backslash? Does the flag denote a return? Is there no backslash used after the last flag in the list?

While on the subject of ./configure, what of the single quotes, are they necessary? I don't see them used too often.

Below is a sample ./configure I got from the MySQL site to demonstrate what I mean:

./configure \
'--prefix=/usr/local/mysql' \
'--disable-dependency-tracking' \
'--enable-assembler' \
'--localstatedir=/usr/local/mysql/data' \
'--libexecdir=/usr/local/mysql/bin' \
'--libdir=/usr/local/mysql/lib' \
'--enable-local-infile' \
'--enable-shared' \
'--enable-thread-safe-client' \
'--with-archive-storage-engine' \
'--with-big-tables' \
'--with-comment=MySQL Community Server (GPL)' \
'--with-extra-charsets=complex' \
'--with-innodb' \
'--with-mysqld-ldflags=-all-static' \
'--with-readline' \
'--with-server-suffix=-standard' \
'--with-unix-socket-path=/tmp/mysql.sock' \
'--with-zlib-dir=bundled' \
'--without-debug' \
'--without-docs' \
'--without-man'

Also why the \ immediately after the ./configure? Rather than say:
./configure --prefix=/usr/local/mysql \
<rest of the text>

is that just to make it neat for the web page and perfectly valid code?

Thank you for your comments.
~Robert
# 2  
Old 04-28-2009
The backslash here has the same meaning as in C: to remove the special meaning from the next character, in this case the newline, making it the same as a regular whitespace. It's used to split a command line into multiple lines for better readability.

And if you want a real challenge AND learn something I'd suggest trying your hand at Linux from Scratch
# 3  
Old 04-28-2009
Pludi:

Thanks for the response, that is a big help. Do you know why the single quotes are being used? I sometimes see them and sometimes not.

As for Linux from scratch....heh, no thanks. I have a hard enough time with Solaris!

~Robert
# 4  
Old 04-28-2009
They aren't really needed in the example, except for the line
Code:
'--with-comment=MySQL Community Server (GPL)'

to tell the shell not to split on the whitespaces but leave them as part of the parameter. It could also be written as
Code:
--with-comment='MySQL Community Server (GPL)'

# 5  
Old 04-28-2009
If I was not using a comment flag, would the single quotes not otherwise been needed?
# 6  
Old 04-28-2009
Probably not, at least not in this example. If you suspect that there's a character that the shell could interpret differently than what you indented, there's almost never harm in adding quotes.
# 7  
Old 04-28-2009
OK, great. Thanks Pludi!
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

Not able to input \ backslash when vi editor

Hi, How do I input \ when I do a vi of my file ? I try to input the \ but it came out as @. Appreciate any help. (4 Replies)
Discussion started by: snowfrost88
4 Replies

2. Shell Programming and Scripting

md5sum on a file with backslash in its name

Hi there, I found something very weird! Should I report that as a bug or is it me misusing the command? I've got a file with a backslash in its name. I know it's a horrible policy but it's not me. The file came from a mac computer because this is a backup server. Anyway, when using... (8 Replies)
Discussion started by: chebarbudo
8 Replies

3. UNIX for Dummies Questions & Answers

Weird behavior of backslash, please help!!

Hi I am getting absurd behavior of escape character in echos as followed:oinlcso003{arsadm} #: echo "\as shdd" \as shdd oinlcso003{arsadm} #: echo "Well, isn't that \"special\"?" Well, isn't that "special"? oinlcso003{arsadm} #: echo "Well, isn't that \special\?" Well, isn't that \special\?... (3 Replies)
Discussion started by: nixhead
3 Replies

4. Shell Programming and Scripting

Echo backslash

If I echo "\\" I get a backslash returned ~$ echo "\\" \ Why doesn't this work: string=`echo "\\"` echo $string I get the error message: bash: command substitution: line 1: unexpected EOF while looking for matching `"' bash: command substitution: line 2: syntax error: unexpected end... (2 Replies)
Discussion started by: locoroco
2 Replies

5. Homework & Coursework Questions

Print questions from a questions folder in a sequential order

1.) I am to write scripts that will be phasetest folder in the home directory. 2.) The folder should have a set-up,phase and display files I have written a small script which i used to check for the existing users and their password. What I need help with: I have a set of questions in a... (19 Replies)
Discussion started by: moraks007
19 Replies

6. UNIX for Dummies Questions & Answers

eval removes backslash

Hi, ============= In one of my config files, I have below command eval echo RECORDDELIMITER '\n' The above command results in removing backslash and outputs: RECORDDELIMITER n ============= Any workaround to retain the backslash after eval. Appreciated for your... (10 Replies)
Discussion started by: axes
10 Replies

7. Shell Programming and Scripting

sed variable and backslash

I am trying to write a bash shell script, which extracts a sentence from a dynamically created dynamic file and passes it as a variable to sed and uses that sentence as a starting point to pull the content from a log file. the key part of the script is this key=`cat /tmp/dynamic` sed -n... (3 Replies)
Discussion started by: fedora
3 Replies

8. UNIX for Dummies Questions & Answers

Escaping backslash

I have a variable containt something like this, c:\mask\mask. How can I escape "\" in the values? I want the value as it it. (9 Replies)
Discussion started by: swmk
9 Replies

9. UNIX for Dummies Questions & Answers

Backslash in find command

When I run my script in debug mode I see that \ is not getting executed as part of command. It is being treated as escape character. find ${DATABASE_PARAM_PATH} -mtime +${RETENTION_PERIOD} -exec rm -rf {} \; Command execution output in debug mode : find... (1 Reply)
Discussion started by: findprakash
1 Replies

10. UNIX for Dummies Questions & Answers

backslash issues

Hi, I have a script which looks through an input file and takes data from the file to use within the script. Everything works fine until the script reads the item \windows\directory\structure\ from the input file into a variable. As unix sees the backslash as an escape character, the... (5 Replies)
Discussion started by: Bab00shka
5 Replies
Login or Register to Ask a Question