Skip to content

Commit eba6086

Browse files
authored
Merge pull request #125 from boegel/head_tail
use `head -n 1` instead of `head -1` (likewise for `tail`)
2 parents cf64753 + cde3303 commit eba6086

File tree

6 files changed

+6
-6
lines changed

6 files changed

+6
-6
lines changed

EESSI-install-software.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ fi
207207

208208
# the install_scripts.sh script relies on knowing the location of the PR diff
209209
# assume there's only one diff file that corresponds to the PR patch file
210-
pr_diff=$(ls [0-9]*.diff | head -1)
210+
pr_diff=$(ls [0-9]*.diff | head -n 1)
211211
export PR_DIFF="$PWD/$pr_diff"
212212

213213
# Only run install_scripts.sh if not in dev.eessi.io for security

bot/test.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ if [[ ! -z ${SINGULARITY_CACHEDIR} ]]; then
100100
fi
101101

102102
# try to determine tmp directory from build job
103-
RESUME_DIR=$(grep 'Using .* as tmp directory' slurm-${SLURM_JOBID}.out | head -1 | awk '{print $2}')
103+
RESUME_DIR=$(grep 'Using .* as tmp directory' slurm-${SLURM_JOBID}.out | head -n 1 | awk '{print $2}')
104104

105105
if [[ -z ${RESUME_DIR} ]]; then
106106
RESUME_TGZ=${PWD}/previous_tmp/build_step/$(ls previous_tmp/build_step)

init/eessi_archdetect.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ accelpath() {
181181
nvidia_smi_out=$(mktemp -p /tmp nvidia_smi_out.XXXXX)
182182
nvidia-smi --query-gpu=gpu_name,count,driver_version,compute_cap --format=csv,noheader 2>&1 > $nvidia_smi_out
183183
if [[ $? -eq 0 ]]; then
184-
nvidia_smi_info=$(head -1 $nvidia_smi_out)
184+
nvidia_smi_info=$(head -n 1 $nvidia_smi_out)
185185
cuda_cc=$(echo $nvidia_smi_info | sed 's/, /,/g' | cut -f4 -d, | sed 's/\.//g')
186186
log "DEBUG" "accelpath: CUDA compute capability '${cuda_cc}' derived from nvidia-smi output '${nvidia_smi_info}'"
187187
res="accel/nvidia/cc${cuda_cc}"

init/eessi_environment_variables

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ if [ -d $EESSI_PREFIX ]; then
5959
fi
6060

6161
if [[ $accelpath_exit_code -eq 0 ]]; then
62-
export EESSI_ACCEL_SUBDIR=$(tail -1 $tmpout && rm -f $tmpout)
62+
export EESSI_ACCEL_SUBDIR=$(tail -n 1 $tmpout && rm -f $tmpout)
6363
if [ -z ${EESSI_ACCEL_SUBDIR} ]; then
6464
error "accelerator detection with archdetect worked, but no result was returned?!"
6565
else

run_tests.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ source ${base_dir}/init/eessi_defaults
2020
# Make sure we clone the latest version. This assumes versions are of the format "v1.2.3", then picks the latest
2121
# then checks it out
2222
TEST_CLONE="git clone https://github.com/EESSI/test-suite EESSI-test-suite && cd EESSI-test-suite"
23-
LATEST_VERSION="VERSION=\$(git tag | grep '^v[0-9]\+\.[0-9]\+\.[0-9]\+$' | sort -t. -k 1,1n -k 2,2n -k 3,3n | tail -1)"
23+
LATEST_VERSION="VERSION=\$(git tag | grep '^v[0-9]\+\.[0-9]\+\.[0-9]\+$' | sort -t. -k 1,1n -k 2,2n -k 3,3n | tail -n 1)"
2424
CHECKOUT_LATEST="git checkout \${VERSION}"
2525

2626
# Git clone has to be run in compat layer, to make the git command available

scripts/gpu_support/nvidia/link_nvidia_host_libraries.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ check_nvidia_smi_info() {
223223

224224
if nvidia-smi --query-gpu=gpu_name,count,driver_version,compute_cap --format=csv,noheader > "$nvidia_smi_out" 2>&1
225225
then
226-
nvidia_smi_info=$(head -1 "${nvidia_smi_out}")
226+
nvidia_smi_info=$(head -n 1 "${nvidia_smi_out}")
227227
HOST_GPU_CUDA_VERSION=$(echo "${nvidia_smi_info}" | sed 's/, /,/g' | cut -f4 -d,)
228228
HOST_GPU_DRIVER_VERSION=$(echo "${nvidia_smi_info}" | sed 's/, /,/g' | cut -f3 -d,)
229229
echo_green "Found host CUDA version ${HOST_GPU_CUDA_VERSION}"

0 commit comments

Comments
 (0)