OpenCores
URL https://opencores.org/ocsvn/s1_core/s1_core/trunk

Subversion Repositories s1_core

[/] [s1_core/] [trunk/] [tools/] [bin/] [test_var] - Blame information for rev 110

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 110 albert.wat
#!/bin/bash
2
 
3
# This script is not supposed to be run stand-alone, it is usually included by other scripts
4
# to check that an environment variable is set and that the corresponding directory does exist.
5
 
6
if (test $# != 1) then
7
  echo "Usage: $0 VAR_NAME"
8
  exit 1;
9
fi
10
 
11
var_name=$1
12
eval dir_name=\$$var_name
13
 
14
if [ -z "$dir_name" ]; then
15
  echo "***ERROR***: Environment variable $var_name is undefined, please set it in the sourceme file and source it."
16
  exit 1
17
fi
18
 
19
if [ ! -d "$dir_name" ]; then
20
  echo "***ERROR***: Directory $dir_name does not exist, please check it and run 'source sourceme' again."
21
  exit 1
22
fi
23
 
24
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.