Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.
IRSTLM=$HOME/irstlm

I need help setting this variable up. Was wondering if this is correct syntax

IRSTLM=/home/user/irstlm

Is that possible to run from root? I need it to be done in root in order to access certain files, I can also add the rest of the command I am trying to run if you'd like to see the context it's being used inn.

New problem, don't know why but shouldn't this output the file with extension .arpa ? i dont seem to get that file and I require it to run the next command to finish compiling this program.

~/irstlm/bin/add-start-end.sh  < ~/corpus/news-commentary-v7.fr-en.true.en > news-commentary-v7.fr-en.sb.en export IRSTLM=$HOME/irstlm; ~/irstlm/bin/build-lm.sh -i  news-commentary-v7.fr-en.sb.en  -t ./tmp  -p -s improved-kneser-ney -o news-commentary-v7.fr-en.lm.en 

Here is the full command:

/home/user/irstlm/bin/add-start-end.sh  < /home/user/corpus/news-commentary-v7.fr-en.true.en > news-commentary-v7.fr-en.sb.en export IRSTLM=$HOME/irstlm; /home/user/irstlm/bin/build-lm.sh -i  news-commentary-v7.fr-en.sb.en  -t ./tmp  -p  -s improved-kneser-ney -o news-commentary-v7.fr-en.lm.en 
share|improve this question
    
Please do provide more context! rootie tootie toot :) –  izx Jun 26 '12 at 15:26
    
I updated the post with the full command –  Brayan Hernandez Jun 26 '12 at 15:34
add comment

2 Answers

If it's a one-off command, you're better of just setting it for that command, i.e.:

IRSTLM=/home/user/irstlm /home/user/irstlm/bin/add-start-end.sh  \
  < /home/user/corpus/news-commentary-v7.fr-en.true.en > news-commentary-v7.fr-en.sb

If it is part of a script use:

export IRSTLM=/home/user/irstlm
/home/user/irstlm/bin/add-start-end.sh < /home/user/corpus/news-commentary-v7.fr-en.true.en > news-commentary-v7.fr-en.sb
share|improve this answer
1  
And if it needs to be persistent across shell sessions, use the .bashrc or whatever other dotfiles are relevant. –  belacqua Jun 26 '12 at 15:52
add comment
up vote 0 down vote accepted

I figured it out, thanks for the suggestions, they definitely helped, here the final command I ran, it seems I wasn't correctly setting the variable as "irstlm=/root/irstlm" final command:

 /root/irstlm/bin/add-start-end.sh < /home/user/corpus/news-commentary-v7.fr-en.true.en> news-commentary-v7.fr-en.sb.enexport IRSTLM=$HOME/irstlm; /root/irstlm/bin/build-lm.sh -i news-commentary-v7.fr-en.sb.en -t ./tmp -p -s improved-kneser-ney -o news-commentary-v7.fr-en.lm.en 
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.