LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 08-16-2004, 04:00 PM   #16
Warmduvet
Member
 
Registered: Jun 2004
Location: New Zealand
Posts: 60

Original Poster
Rep: Reputation: 15

Thanks for all the replies and suggestions.

WD
 
Old 08-16-2004, 06:50 PM   #17
bulliver
Senior Member
 
Registered: Nov 2002
Location: Edmonton AB, Canada
Distribution: Gentoo x86_64; Gentoo PPC; FreeBSD; OS X 10.9.4
Posts: 3,760
Blog Entries: 4

Rep: Reputation: 78
The advanced bash scripting guide is a good online resource:
http://www.tldp.org/LDP/abs/html/index.html

If you need something a little more basic try the Bash Guide for Beginners:
http://www.tldp.org/LDP/Bash-Beginne...tml/index.html
 
Old 08-16-2004, 07:19 PM   #18
jlliagre
Moderator
 
Registered: Feb 2004
Location: Outside Paris
Distribution: Solaris 11.4, Oracle Linux, Mint, Debian/WSL
Posts: 9,789

Rep: Reputation: 492Reputation: 492Reputation: 492Reputation: 492Reputation: 492
JLM-TOC,

2) the history exansion problem you describe is real, but is only concerning interactive shells. Shell scripts shouldn't be affected.
 
Old 02-08-2007, 05:20 AM   #19
jons
LQ Newbie
 
Registered: Feb 2007
Posts: 3

Rep: Reputation: 0
Cool [bash] new to bash, having problems debugging.

oops posted in wrong place.
 
Old 06-01-2013, 05:13 AM   #20
TheDexxter24
LQ Newbie
 
Registered: Jun 2013
Posts: 1

Rep: Reputation: Disabled
Quote:
sh, ksh, and bash don't allow unquoted spaces in shell-variable assignments.
So:
FILES=/usr/local/rpm /etc/samba /etc/httpd
will set FILES to "/usr/local/rpm" and then try to execute:
/etc/samba /etc/httpd
You can also put some '\' before the space to say "don't take care about what's following"
So you'll have:
FILES=/usr/local/rpm\ /etc/samba /etc/httpd

Sorry for my bad english :S
 
Old 06-02-2013, 06:32 AM   #21
David the H.
Bash Guru
 
Registered: Jun 2004
Location: Osaka, Japan
Distribution: Arch + Xfce
Posts: 6,852

Rep: Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037
Just to warn everyone, this is 9 year old necro-thread.

In the future, please consider whether what you want to add is important enough to justify re-opening a long-dead thread. Thanks.

While I'm here, I'm going to add my own comment though, and say that lists of filenames should not be stored in a single variable anyway. Always use arrays when you have multiple related strings to operate on.

Code:
files=( /usr/local/rpm /etc/samba /etc/httpd  )
printf 'This is file: %s\n' "${files[@]}"
 
Old 10-08-2013, 10:28 AM   #22
dy20082250
Member
 
Registered: Oct 2013
Location: China
Distribution: Fefora 9
Posts: 81

Rep: Reputation: Disabled
Question I also have a similar question about 'fi'

INSTDIR=/home/wdy/Download
if [ -d $(INSTDIR) ];\
then\
cp myapp $(INSTDIR);\
chmod a+x $(INSTDIR)/myapp;\
chmod og-w $(INSTDIR)/myapp;\
echo "Installed in $(INSTDIR)";\
else\
echo "sorry,$(INSTDIR) does not exist";\
fi



run it and the error:syntax error near unexpected token 'fi'
but why? ican not find the reason.
 
  


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
error: unexpected token `newline' CarlosV Programming 4 05-17-2011 03:47 AM
Many errors when 'make'ing (example: error: syntax error before `::' token) darkblade Linux - Software 5 03-02-2005 03:00 PM
got a syntax error which shows unexpected end of line when tried to run a shell scrip racer_mec Linux - Newbie 1 01-10-2005 01:43 AM
C++ syntax error before :: token HELP, i cant find the syntax error :( qwijibow Programming 2 12-14-2004 06:09 PM
Undecodable token error ?? Thymox Linux - General 3 11-18-2002 06:11 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 10:36 AM.

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