Bash Script to display directories in Path?


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Bash Script to display directories in Path?
# 1  
Old 11-09-2005
Bash Script to display directories in Path?

Hello there,

As a newbie:

The directories in PATH can be hard to distinguish when printed out as
one line with colon .Please, can i have a sample script to display
them,one to a line.

Thank you.
# 2  
Old 11-09-2005
Code:
echo "$PATH" | tr ':' '\n'

Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Need help: Script to report timestamp of directories in a specific path from multiple Linux server

Need help Please help on how to write a script which can echo timestamp, size of subdirectories in a specific path from multiple Linux servers to a text file. I can ssh with a common user to all the servers from a build box. Basic idea what I had was: ssh <commonuser>@<each box> cd... (1 Reply)
Discussion started by: sudhichadaga
1 Replies

2. Shell Programming and Scripting

How to list all the files, directories and sub-directories in the current path except one directory?

Can anyone come up with a unix command that lists all the files, directories and sub-directories in the current directory except a folder called log.? Thank you in advance. (7 Replies)
Discussion started by: Manjunath B
7 Replies

3. UNIX for Dummies Questions & Answers

Getting path name using bash script

I have this code to extract the directory name ($0:h) in tcsh. I am converting the code to bash and need a way to get the equivalent setting for DefRaytracPath set DefRaytracPath = `echo $0:h | awk 'BEGIN {FS="/tcsh"} {print $1"/prog"}'` (3 Replies)
Discussion started by: kristinu
3 Replies

4. Shell Programming and Scripting

bash script to display tail

Hi everyone, I'm trying to write a script to format a file using unix2dos. I want to output all but the first 14 lines in a file. Then I want to pipe this to unix2dos to convert the output to a file that's easily readable on windows. Here's what I have: export Lines=`wc -l < $1` export... (11 Replies)
Discussion started by: LuminalZero
11 Replies

5. Shell Programming and Scripting

Importing a path/file into a bash script

Hey, I'm new here. Basically, I'm trying to make a bash script that affects a file of my choice. What I want to do is $./script.sh /path/to/file.jpg and then the bash script will know that variable=/path/to/file.jpg Thanks! (4 Replies)
Discussion started by: TFB
4 Replies

6. Shell Programming and Scripting

How to write a shell script to display files in single path?

Hello friends, I am a script which dispalys a multiple files with their contents. for exm: suppose two file test1.txt and test2.txt. when I run my script it have to display the below O/P. test1.txt -rw-r----- 1 sranga staff 91 Sep 23 02:18 calc.sh -rw-r----- 1 sranga ... (2 Replies)
Discussion started by: sivaranga001
2 Replies

7. Shell Programming and Scripting

bash script to rename multiple directories

Hello I have a directory structure with year in format 4 digits, e.g 2009, below which is month format 1 or 2 digits, e.g 1 or 12, blow which is day format 1 or 2 digits, e.g 1 or 31. I want to change the names of lots of directories to the be Year - 4 digits , e.g 2009 - No change here... (4 Replies)
Discussion started by: garethsays
4 Replies

8. Shell Programming and Scripting

Bash script: issue changing directories in script

I am working on a script that checks two arguments at the command line. The first argument is a search pattern, the second can be a file or a directory, if it is a file a second script is called that checks it for the search pattern. If the second argument is a directory, it checks for the search... (5 Replies)
Discussion started by: Breakology
5 Replies

9. Shell Programming and Scripting

Recursive call to find files and directories in Shell script from current path.

################################################################ Copy this script to your path from where you want to search for all the files and directories in subdirectories recursively. ################################################################# code starts here... (2 Replies)
Discussion started by: Ramit_Gupta
2 Replies

10. Shell Programming and Scripting

(w)get web server's directories + bash script

Hi everyone. I need to write a script which will download files/folders (a huge collection) to the local file server (centOS 4.4 Server), and check regularly (every 6 hours or so if any new files are present, or if the old ones were modified to update contents). Any insights on how to tackle... (2 Replies)
Discussion started by: reminiscent
2 Replies
Login or Register to Ask a Question