Questions tagged [readlink]

38 questions
0
votes
2 answers

readlink command misbehave after issueing pushd command in bash scripts

I came across one complex problem I tried to explain it with simple example as below In my system I have ubuntu@ubuntu:~/temp$ pwd /home/ubuntu/temp ubuntu@ubuntu:~/temp$ ls temp1 test.sh ubuntu@ubuntu:~/temp$ In temp.sh I have #!/bin/bash echo…
Jeegar Patel
  • 26,264
  • 51
  • 149
  • 222
0
votes
3 answers

strange behaviour with readlink under cmake

I'm trying to use readlink -f to get the absolute path to a shared library following all symlinks. >readlink -f /opt/gcc4.9.3/lib64/libstdc++.so.6 /opt/gcc4.9.3/lib64/libstdc++.so.6.0.20 but when I do this in cmake it doesn't expand the full…
Bruce Adams
  • 4,953
  • 4
  • 48
  • 111
0
votes
1 answer

How to use Readlink

How do I use Readlink for fetching the values.
0
votes
1 answer

Absolute path to symbolic link

Is there possibility of retrieving absolute path of symbolic file in bash? I cannot use realpath() and readlink() gives path of target. But i need absolute path of that symlink.
0
votes
1 answer

how to filter a command subsitution from the resulting value of a readlink for symlink?

This may be poorly titled as I'm not fully sure what the process is called. Basically I want to get only the last part of a symlink path, and I'm trying to use the same method I use with PWD. For example: if I do PWD it prints /opt/ct/mydir if I…
Dss
  • 2,162
  • 1
  • 24
  • 27
0
votes
2 answers

Why does not the readlink show the full path?

I'm making a shell script to search for files with a specific name and show their full path and size. For example: /home/miglui/Desktop/SO/teste/1/teste.txt: 14 bytes The code of the segment that I'm having trouble is the next: for i in `find $1…
Miguel
  • 69
  • 5
0
votes
2 answers

Readlink - How to crop full path?

I use readlink to find a file's full path: cek=$(readlink -f "$1") mkdir -p "$ydk$cek" mv "$1" "$ydk/$cek/$ydkfile" But readlink -f "$1" gives me the full path. How can I crop the full path? For example: …
onur
  • 5,647
  • 3
  • 23
  • 46
-1
votes
2 answers

Resolving path with bash

On I am on MacOS, but looking for a cross-platform solution that will also work on *nix. Simple question, how can I resolve this path with bash a script? /Users/Olegzandr/.nvm/versions/node/v7.2.0/bin/../lib/node_modules/suman/cli/cli.sh This path…
Alexander Mills
  • 90,741
  • 139
  • 482
  • 817
1 2
3