bash script error in array definition.

2009-05-27 Thread straygrey

Please tell me what is wrong with the following line that I have in a bash
script:-
[code]
TODAYDATE=`date +"%Y%m%d"`
declare -a FiLeS=( $TODAYDATE.TeleformDB.tar.bz2
$TODAYDATE.TeleformDB2.tar.bz2 )
[/code]
When I run it I get:-
Syntax error: "(" unexpected

-- 
View this message in context: 
http://www.nabble.com/bash-script-error-in-array-definition.-tp23739928p23739928.html
Sent from the Gnu - Bash mailing list archive at Nabble.com.





Re: bash script error in array definition.

2009-05-27 Thread Greg Wooledge
On Wed, May 27, 2009 at 03:33:10AM -0700, straygrey wrote:
> Please tell me what is wrong with the following line that I have in a bash
> script:-
> [code]
> TODAYDATE=`date +"%Y%m%d"`
> declare -a FiLeS=( $TODAYDATE.TeleformDB.tar.bz2
> $TODAYDATE.TeleformDB2.tar.bz2 )
> [/code]
> When I run it I get:-
> Syntax error: "(" unexpected

arc1:~$ dash 
\h:\w$ x=(a b c)
dash: Syntax error: "(" unexpected

Your script is not being executed by bash.  Most likely you either have
#!/bin/sh at the top of it (with /bin/sh being a link to dash or some
other shell that isn't bash), or you're typing "sh myscript" to run it.




read -e bug

2009-05-27 Thread Chris F.A. Johnson

This is nothing new; it happens in all versions of bash:

printf "Enter something: "
read -e whatever

Press a key, then cursor left (or ^A); the cursor moves to the
beginning of the line, over "E" instead of over the character just
entered.

-- 
   Chris F.A. Johnson, webmaster 
   ===
   Author:
   Shell Scripting Recipes: A Problem-Solution Approach (2005, Apress)