LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 10-30-2015, 09:46 PM   #1
BrainPowered
LQ Newbie
 
Registered: Oct 2015
Location: New Braunfels, TX
Distribution: Mint Cinnamon
Posts: 27

Rep: Reputation: Disabled
directory names and bash


17.2:
I want to name folders in an outline format like:

~/MyDir/III. Operations/D. Marketing/01. Management/A). Analytics/

When I use terminal to reference the directory I get "syntax error near )"
and Analytics is not a directory (without the A).

What is happening here? I thought there wasn't any problem naming files and directories with periods (dots) and can use characters with some exceptions like '/', '0', and maybe '_'

Last edited by BrainPowered; 10-30-2015 at 09:50 PM.
 
Old 10-30-2015, 09:57 PM   #2
berndbausch
LQ Addict
 
Registered: Nov 2013
Location: Tokyo
Distribution: Mostly Ubuntu and Centos
Posts: 6,316

Rep: Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002
Parentheses and blanks have special meaning in bash. To remove that meaning, you need to quote them. Examples:
Code:
mkdir "A). Analytics"
mkdir 'A). Analytics'
mkdir A\).\ Analytics
Within two double quotes, the special meaning of almost all characters is removed.
Single quotes work on all characters except single quotes.
The backslash quotes a single character.

Last edited by berndbausch; 10-30-2015 at 10:01 PM.
 
1 members found this post helpful.
Old 10-30-2015, 11:26 PM   #3
BrainPowered
LQ Newbie
 
Registered: Oct 2015
Location: New Braunfels, TX
Distribution: Mint Cinnamon
Posts: 27

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by berndbausch View Post
Parentheses and blanks have special meaning in bash.
Ok. I can work with that.
Thanks berndbausch.
 
  


Reply



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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Remove whitespace in file and directory names using bash TheFutonEng Programming 14 02-26-2012 12:35 PM
Bash script to make 100 directory recursively with different names.. meet10may Linux - Newbie 3 08-09-2011 09:43 AM
Bash: bash file names are different than openbox trash file names whatthefunk Programming 4 02-15-2011 01:52 AM
[SOLVED] How to changing same file names by their directory names? bayaraa_u Linux - General 3 04-09-2010 08:26 AM
Getting directory names from a given path in Bash? ojha_riddhish Programming 10 04-13-2009 05:08 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 04:10 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration