Menu

#22 Command line variables starting with # fails in linux

2.1.0
closed
5
2025-09-06
2010-03-29
Anonymous
No

Passing variables to scripts in command line in linux with # fails. I guess bash thinks its as a comment and won't process them.

I recommned changing this character to something else like +-character.

CommandLine.java line 191 in b2.1

Discussion

  • christian

    christian - 2010-04-17

    +1

     
  • christian

    christian - 2010-04-20

    It just hits me :-) ... # is the bash comment sign. if you escape it, everyhing works well. would you please document this on your page? thanks chris

    not working:

      java -jar webharvest_all_2.jar config="scoach_tables.xml" #isin=CH0110581516
    

    working:

      java -jar webharvest_all_2.jar config="scoach_tables.xml" \#isin=CH0110581516
    
     

    Last edit: Maciej Czapiewski 2012-11-16
  • Piotr Dyraga

    Piotr Dyraga - 2012-11-15
    • milestone: --> Backlog
     
  • Maciej Czapiewski

    • assigned_to: Maciej Czapiewski
     
  • Maciej Czapiewski

    • status: open --> pending
    • milestone: Backlog --> 2.1.0rc1-RELEASE
     
  • Maciej Czapiewski

    The way of defining initial variables of the Web-Harvest context from command line has been modified. Now it accepts only one parameter vars instead of many parameters with # prefix which under Linux were not be passed to the application - # is the line comment character in the Linux shell.

    The vars parameter contains a semicolon-separated list of pairs <name>=<value>, where <name> is a name of WH variable and <value> is its value. Below is presented sample command containig vars parameter with two variables a and B:

    java -jar webharvest-ide-2.1.0-SNAPSHOT.jar config="commandline_params.xml" vars="a=john;B=123"
    

    Of course this modification will be available in Web-Harvest v2.1.

    Thanks,
    Maciej

     
  • Maciej Czapiewski

    • status: pending --> closed
     

Anonymous
Anonymous

Add attachments
Cancel





MongoDB Logo MongoDB