Stanford parse bash script error - linux bash?

You could try: for file in `dir -d *` do $HOME/segment. Sh ctb "$file" UTF-8 done So there were a couple of things to correct: Don't use : after the for statement, use ; or a newline Use angled quotation marks or $(dir -d) for your statement to execute the command dir.. Put quotation marks around the "$file" object to allow whitespaces in file name.

2 In other words, the : is wrong in the original post - he could also just change it to a ; – Mark Longair Mar 11 at 8:31 yep now the bash is correct but the 'dir -d' is messing with my options flag of the segment. Sh command. – 2er0 Mar 11 at 8:31 the loop works now.

But it's messing with my commands. Hmmmm... – 2er0 Mar 11 at 8:36 ahhh the angled quotion marks are messing the dir in the command! Solved.

The angled quotation marks reads the directory properly – 2er0 Mar 11 at 8:45.

For file in 'dir -d *': do You've put a colon instead of a semicolon. If you want an easy debugging, you can add -x as an option to your shebang : #! /bin/bash -x The errors will be easier to spot.

As well as the : (colon), which should be a ; or a new line, the 'dir -d *' doesn't do what you think it does - the loop will just have one iteration, where file is a long string beginning with dir -d and with all your files afterwards. Also, you initially change to a path based on $file but then reuse the variable file in your loop, which is suspect. I'm having to guess somewhat about your intent, but it can be much simpler, e.g. : #!

/bin/bash cd ~/path/to/whereever for file in * do ~/chinesesegmenter-2006-05-11/segment. Sh ctb "$file" UTF-8 done Even if you used the (more correct) version with backticks: for file in `dir -d *` ... it would still qualify for a Useless Use of ls * Award ;) Update: originally I forgot to quote $file, as pointed out in another answer.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions