April 8th, 2011, 07:46 PM
Add variable to shortened path
I'm not quite sure how to explain this, but basically I want to take the path (not the entire path, but an abbreviated path) of the current directory and add the argument passed onto the script to that path.
This is the code I'm using
When I run my script with 'BTP100' as $1, I only get:
"/$(pwd | sed 's/\// /g')"
/ home drey5
I should point out that drey5 is the directory where I run my script from, so I don't think that I'm switching to the directory I specified as my argument.
I'd want my output to look something along the lines of:
/ home drey5 BTP100
April 10th, 2011, 07:01 AM
It works for me ... IF I put an echo before the output string.
What shell are you using and what happens if you run those two command by hand from the command line?
The moon on the one hand, the dawn on the other:
The moon is my sister, the dawn is my brother.
The moon on my left and the dawn on my right.
My brother, good morning: my sister, good night.
-- Hilaire Belloc