Projet

Général

Profil

Partage » irods-http-url.sh

Pierre Gay, 29/04/2025 09:46

 
1
#! /bin/bash
2

    
3
path=$1
4

    
5
coll=$(dirname "$path")
6
data=$(basename "$path")
7

    
8
# Test if path is relative
9
if [ $(realpath -m "$coll") != "$coll"  ] ; then
10
    # use ipwd to get absolute collection name
11
    coll=$(realpath -m "$(ipwd)/$coll")
12
fi
13

    
14
# build URL
15
iquest "https://%s%s/%s" "SELECT RESC_LOC, COLL_NAME, DATA_NAME WHERE DATA_NAME = '$data' AND COLL_NAME = '$coll'"
(4-4/4)