Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
embltilities
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Renato Alves
embltilities
Commits
d19b2eda
Verified
Commit
d19b2eda
authored
7 years ago
by
Renato Alves
Browse files
Options
Downloads
Patches
Plain Diff
ENH perms - display permissions of target up to the root of the filesystem
parent
d2d443c5
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
README.rst
+1
-0
1 addition, 0 deletions
README.rst
bin/perms
+47
-0
47 additions, 0 deletions
bin/perms
with
48 additions
and
0 deletions
README.rst
+
1
−
0
View file @
d19b2eda
EMBL utilities
==============
``perms`` - a script to display permissions of a target file/folder up to the root of the filesystem (useful when granting permissions to someone else).
``submitjob`` - a polyglot script that submits jobs to SGE, LSF and SLURM clusters.
This diff is collapsed.
Click to expand it.
bin/perms
0 → 100755
+
47
−
0
View file @
d19b2eda
#!/usr/bin/env bash
# perms.sh -- created 2016-06-05, Renato Alves
usage
()
{
echo
>
&2
""
echo
>
&2
"Usage:"
echo
>
&2
"
$0
[path]"
echo
>
&2
""
echo
>
&2
"Optional parameters:"
echo
>
&2
" path = if not given, the current work directory is used"
echo
>
&2
""
}
function
uptree
{
[
"x
$1
"
==
"x"
]
&&
return
# NOTE The \ in \ls is meant to ensure 'ls' is not a shell alias
(
\l
s
-ld
--
"
$1
"
;
[
"
$1
"
=
'/'
]
&&
return
;
uptree
"
$(
dirname
"
$1
"
)
"
)
| column
-t
}
# Parse args using getopt (instead of getopts) to allow arguments before options
ARGS
=
$(
getopt
-o
h
-n
"
$0
"
--
"
$@
"
)
# reorganize arguments as returned by getopt
eval set
--
"
$ARGS
"
while
true
;
do
case
"
$1
"
in
# Shift before to throw away option
# Shift after if option has a required positional argument
-h
)
shift
usage
&&
exit
0
;;
--
)
shift
break
;;
esac
done
if
[
"$#"
==
"1"
]
;
then
DIR
=
$(
readlink
-f
"
$1
"
)
else
DIR
=
$(
pwd
-P
)
fi
uptree
"
$DIR
"
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment