what is the significance of braces and spaces???


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting what is the significance of braces and spaces???
# 1  
Old 09-03-2006
what is the significance of braces and spaces???

Hi ,

i have few doubts about the braces and spaces which are quite often used:

for instance:

when i try the belo command it will not work
Code:
export variable=  cat filename

rather when i try the cat command without any space it works fine

export variable=cat filename

Code:
and what is the significance of the {} braces???

for instance:
Code:
find . -name "*" {} -print 
what is the need of double braces like in if condition [[ ]]???


Code:
and also, could you please let me know some good references for scripting so that i could refer that in future?


Thanks in advance.

Cheers,
Waseem
# 2  
Old 09-03-2006
Here is good tutorial which can answer most of your queries:
http://www.awprofessional.com/articl...&seqNum=3&rl=1

About Shell quotes, check here:
http://www.grymoire.com/Unix/Quote.html

About Shell Tutorial, check Tutorials section at FAQs.

Regards,
Tayyab
# 3  
Old 09-03-2006
Hey tayyab,

thanks for your reply. Howerver, I was looking for something else, like why doesnt unix ignore the space that i gave before the cat command? and also, what is the difference between () braces and {} braces used in variables? and when do we use [] braces and () braces in conditions? and why do we use [[ ]] braces in conditions? and why do we use empty {} braces in commands??????


and also, finally, i was looking for some good e-learning material like some pdf's or online reference or anything of that sort, since, i aint got enough money to buy books

Cheers.
Waseem

Last edited by ahmedwaseem2000; 09-03-2006 at 12:10 PM..
# 4  
Old 09-03-2006
Simply becasue it is a language and you have to follow the "grammar", if you don't it doesn't understand you.

The {} braces are part of the syntax of the find command.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

How to remove newline, tab, spaces in curly braces.. :( Pls Help?

Hi Everyone, in the below "xyz (Exception e)" part... after the curly braces, there is a new line and immediately few tabs are present before closing curly brace. xyz (Exception e) { } note: there can be one or more newlines between the curly braces. My desired output should be ... (6 Replies)
Discussion started by: NY_777
6 Replies

2. UNIX for Dummies Questions & Answers

Significance of different shells?

I'm taking a LINUX and UNIX class and we are using bash as the shell in terminal. On my mac-book I use zsh only because my professor had a pretty cool start-up file for it. It has benefited me in becoming familiar with different shells. However, I'm having a hard time understanding the purpose... (4 Replies)
Discussion started by: syregnar86
4 Replies

3. Shell Programming and Scripting

Significance of ':-' while accessing a variable

Hi I was trying to understand what ':-' means when used with variables echo ${x:-10} if Thanks (4 Replies)
Discussion started by: zulfi123786
4 Replies

4. Solaris

significance of pfiles

What is the significance of pfiles? What is the use of it and how and where to use it?:wall: (2 Replies)
Discussion started by: varunksharma87
2 Replies

5. Shell Programming and Scripting

Significance of forward slash(/) while specifying a directory

What is the significance of the forward slash(/) while specifying a directory? cp -av /dir/ /opt/ and cp -av /dir /opt Does effectively the same job it seems? (2 Replies)
Discussion started by: proactiveaditya
2 Replies

6. Shell Programming and Scripting

Significance of '{}' \;

What is the Significance of '{}' \; in UNIX? (2 Replies)
Discussion started by: Shell_Learner
2 Replies

7. AIX

Group significance in mkrole aix 5.3

Hello... I am getting ready to create a bunch of groups for several of our servers all of which are running Aix 5.3. We really want to keep people away from using the root login and as such the systems have been hardened using aixpert and if it is absolutely needed people must su -. There are... (1 Reply)
Discussion started by: dgaixsysadm
1 Replies

8. UNIX for Dummies Questions & Answers

significance of statement

Hi, I am a newbie in unix shell scripting and I am trying to understand the result of the following line : ls -l $1*$4*ready I understand the ls-l but the rest is just really confusing. Any help would be appreciated. TIA (3 Replies)
Discussion started by: nickcarter
3 Replies

9. Shell Programming and Scripting

What is the significance of . / ?

Many scripts are executed in the following way. . /scriptname Even when the file does not have execute permission, it can be executed this way. How does this work? (6 Replies)
Discussion started by: krishmaths
6 Replies

10. UNIX for Dummies Questions & Answers

what the significance of ~

what does this symbol ~ represent in unix for example.... If i create directories called personal and lab and lab5 and the command chmod 776~/lab5 is issued. What results would i expect to get. basically i know that chmod 776 would prevent others from executing the files in the directory but... (2 Replies)
Discussion started by: BigTool4u2
2 Replies
Login or Register to Ask a Question