Environment Variable for Local Directory?


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Environment Variable for Local Directory?
# 1  
Old 09-01-2009
Environment Variable for Local Directory?

This seems like a simple thing, but I can't seem to find an environment variable that has the local/current directory stored in it. I have a script that writes out the files in a directory. I want to append the full path to the file names in the output file.
# 2  
Old 09-01-2009
make your own: pwd is the current directory
Code:
thisdir=$(pwd)
ls | 
while read filename
do
    echo "${thisdir}/${filename}"
done

# 3  
Old 09-01-2009
Jim - thanks so much!!!
# 4  
Old 09-01-2009
You have two choices ...
$ set
Would have shown you one ...

$ echo $pwd

Then there is the cmd:
$ pwd

-Enjoy
fh : )_~
# 5  
Old 09-01-2009
thank you - much appreciated
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Replicate remote directory to local directory with ftp

I have system that generate files every 1 hours , i only have ftp connection from my local server to remote . $ ls -al -rw-r--r-- 1 water None 0 Feb 7 18:09 a.0800 -rw-r--r-- 1 water None 0 Feb 7 18:09 a.0900 -rw-r--r-- 1 water None 0 Feb 7 18:09 a.1000 is there any perl / php... (3 Replies)
Discussion started by: before4
3 Replies

2. Shell Programming and Scripting

FTP files from different directory from remote server to one directory in local

Hi All, I want to search for .log files from folders and sub folders in remote server and FTP them to one particular folder in the local machine. I dont want to copy the entire directory tree structure, just have to take all the .log files from all the folders by doing a recursive search from the... (3 Replies)
Discussion started by: dassv
3 Replies

3. OS X (Apple)

local dynamic http development environment

I have scouted around the last few years and always see that for a individual person to create a dynamic development environment in Mac takes a PHD or something close. Or there are a lot of miss leading info. I would rather work with raw code compared to a wysiwyg editor of any flavor. At this... (5 Replies)
Discussion started by: cowLips
5 Replies

4. Shell Programming and Scripting

Expand an environment variable in sed, when the variable contains a slash

I'm trying to make a sed substitution where the substitution pattern is an environment variable to be expanded, but the variable contains a "slash". sed -e 's/<HOME_DIRECTORY>/'$HOME'/'This gives me the following error: sed: -e expression #1, char 21: unknown option to `s'Obviously this is... (2 Replies)
Discussion started by: Ilja
2 Replies

5. Solaris

Environment Variable

Hi All, I am new to SUN Solaris.I have some questions regarding environment variable.:confused: Q1. Where the environment variables available in Solaris. Q2. What command used here. Q3. Can a user change this .Suppose i want to change the bash to ksh can it be possible here. Or i need to... (2 Replies)
Discussion started by: jdash.ps
2 Replies

6. Shell Programming and Scripting

about environment variable

i am not clear at some places i saw that assigning a env var with colon ':' like export PATH=/usr/bin:/usr/ucb:/etc:/usr/sbin:.:/usr/platform/sun4u/sbin here you can find : and a . and again : could some one explain how it works... see all is starting from root directory, how : is used and... (6 Replies)
Discussion started by: Arunprasad
6 Replies

7. Solaris

Environment variable

Hello, For the moment, my LC_ALL variable is set as "" by default. If I want to change this value, I do : export LC_ALL="en_fr" for example. That I want to know it's : how can I set by default this value ? I want to save it on my profile in order to get it when I open my session... :confused:... (2 Replies)
Discussion started by: MasterapocA
2 Replies

8. Shell Programming and Scripting

Using Environment Variable

In our current environment we have each of our testing levels on individual servers (running Korn shell). So, there is a server for dev and test, and 2 servers for qa and prod. I have several scripts that utilize a code that is dependant on the server where it resides. While I was the only person... (3 Replies)
Discussion started by: kaiser
3 Replies

9. UNIX for Dummies Questions & Answers

Environment Variable

$ . oraenv (when i type this at the prompt) ORACLE_SID = ? ( I get this) I understand that . oraenv is a startup script and it has the ENV variable ORACLE_SID. But pls let me know what more it explains and also how to change the env variable here. (2 Replies)
Discussion started by: thumsup9
2 Replies

10. UNIX for Advanced & Expert Users

different environment in each directory

Hi, is it possible to have different environment settings for different directories / sub-directory for the same login?? All that I can think at the moment is creating different scripts say "env" in each directory for setting directory specific environment and also creating a wrapper script ... (2 Replies)
Discussion started by: jyotipg
2 Replies
Login or Register to Ask a Question