Determine path of file



I reference a file from a script through command line parameters.

I.e.
script.sh [referenced file]

The file can be refered to as both absolute and relative path. How can
I easily get the complete (absolute) path independent on whether it is
specified absolute or relative.

I tried with addition of $pwd, but in case of an absolute reference I
run into problems with two consecutive slashes, e.g. /home/kbn/path//
home/kbn/path/file

At the moment I use sed, but I assume some more easy/pretty solutions
exist(?)

Best regards,
Kenneth (the number-one-question-maker)
.



Relevant Pages

  • Re: The Real TWINS Paradox - the Simplest Version
    ... then A's AVERAGE absolute velocity is also at least ... there is no absolute reference. ... According to the transorm these poles will be length contracted ... addition to the contraction of the poles, ...
    (sci.physics.relativity)
  • Re: Fastest Time
    ... >> it's also irrelevant to SR's claim that ranking by absolute ... >> is done in one particular reference frame, ... > Because my model agrees with scientific research. ...
    (sci.physics)
  • Re: Fastest Time
    ... >> it's also irrelevant to SR's claim that ranking by absolute ... >> is done in one particular reference frame, ... > Because my model agrees with scientific research. ...
    (sci.physics.relativity)
  • Re: Is "malfunctioning" absolute or relative?
    ... it depends on the reference ... "Fartherness" is not absolute. ... Strong proponents for that explanation were Lorentz (who laid ... Physics can be done ...
    (sci.physics.relativity)
  • Re: Is "malfunctioning" absolute or relative?
    ... it depends on the reference ... "Fartherness" is not absolute. ... Chicago is farther than ... explanation were Lorentz, ...
    (sci.physics.relativity)