Opened 6 years ago

Closed 6 years ago

Last modified 3 years ago

#1485 closed Bug (fixed)

Unable to use add_key for multiple keys

Reported by: timgraham Owned by: nemo
Priority: normal Milestone: 2015 release-3.6
Component: OCE Version: release-3.6
Severity: Keywords: 2015
Cc:

Description

According to the makenemo help text it should be possible to add multiple keys using the following syntax:
./makenemo add_key "key_iomput key_mpp_mpi"

This results in the following error message (although makenemo continues to build the configuration without adding the keys):
./makenemo: line 203: [: key_iomput: binary operator expected

Commit History (1)

ChangesetAuthorTimeChangeLog
5144timgraham2015-03-11T16:51:28+01:00

Another fix required related to #1485

Change History (5)

comment:1 Changed 6 years ago by timgraham

I think this can be fixed by changing line 203 from:

[ ! -z $2 ] && { list_add_key=$2; export ${list_add_key}; }

to

[ ! -z "$2" ] && { list_add_key=$2; export ${list_add_key}; }

Similarly for line 208. I'm testing the change now.

comment:2 Changed 6 years ago by timgraham

  • Resolution set to fixed
  • Status changed from new to closed

The above syntax doesn't work if " " is passed as the argument. It ends up printing out all environment variables.

Instead the test needs to be:

[[ ! "$2" =~ ^\ +$ ]] && { list_add_key=$2; export ${list_add_key}; }

This checks that the string is not null and contains characters other than white space.

I've fixed this at r5142

comment:3 Changed 4 years ago by nicolasmartin

  • Keywords 2015 nemo_v3_6* added

comment:4 Changed 3 years ago by nemo

  • Keywords release-3.6* added; nemo_v3_6* removed

comment:5 Changed 3 years ago by nemo

  • Keywords release-3.6* removed
Note: See TracTickets for help on using tickets.