How? - List file when changing directories

How? - List file when changing directories

Post by Paul Porcel » Thu, 04 Aug 1994 18:32:57



I would like to display a file when i change to a particular directory.
Could someone explain how to do this.
I notice that on some ftp sites, when you change to some directories they print a file before going to the prompt.
Any ideas/help are much appreciated.
Cheers
--
Paul Porcelli

 
 
 

How? - List file when changing directories

Post by A.K.Srikan » Thu, 04 Aug 1994 23:23:27


I think this should work as long as you display the file like the ftp sites do ie..
there is a file with the same name in every dir.

alias cd chdir \!:\*\;cat $cwd/README

And an answer to a related question asked sometime ago...If you want to display
the current directory as part of the X window Title, add

alias cd chdir \!:\*\;echo -n "^[]2;$PWD^G"

to your .cshrc

Srikanth
---
-------------------------------------------------------------------------------
                    #include "std/disclaimer.h"
Ayikudy K. Srikanth      Software Engineer        Wellfleet Communications Inc.

Ph: (508) 436-8226       Fax : (508) 670-8760     Billerica, MA 01821

 
 
 

How? - List file when changing directories

Post by Stephen P. Pott » Sat, 06 Aug 1994 01:22:09


   I think this should work as long as you display the file like the ftp
   sites do ie..
   there is a file with the same name in every dir.

   alias cd chdir \!:\*\;cat $cwd/README

Hmm.. how about at least putting a little error correction in there?  It
gets very annoying very quickly to see
"cat: /cis/homes/spp/README: No such file or directory"

all the time.  Besides, cat is worthless, usually.  Try more or less.
How about just doing this:

alias cd chdir \!:\*\; [ -f README ] && more README

Steve
--
  University of Florida, Department of Computer and Information Sciences

Click here for the <a href="http://www.cis.ufl.edu/perl">Perl WWW Page</a>
        I BOYCOTT ANY COMPANY THAT USES MASS INTERNET ADVERTISING

 
 
 

1. List file changed today in the directory

Hi,

  I am writing a script that lists changed today. The following is the
script:

  DATE=`date +%d` | sed 's/^0*//'`;export DATE   # (remove 0s in 01,
02, ...etc)
  MONTH=`date +%h`;export MONTH
  ls -ltr FILENAME | awk '$6 == "$MONTH" && $7 == $DATE'

  This script however doesn't return anything. I know the command  
  ls -ltr FILENAME | awk '$6 == "$MONTH" && $7 == $DATE'  works. I
guess awk is not taking DATE and MONTH variable.

  Thanks in advance for your help.

  Nick

2. ANN: Availability of POSIX 1003.1 TC2 Draft 2

3. Directory List of files excluding files without a suffix

4. desktop in X

5. list of files in directory and all subdirectories > files.csv

6. Storage / Backup for Linux (non-expensive)

7. kshell script to change to a directory kept in a list

8. Wierd memory problem

9. Files listing, how to list only the 10 most recent files

10. How to automatically list the current content directory while enters into a directory

11. how to list ONLY DIRECTORIES in a directory...

12. Virtual Directory as a list of directories, is it possible?

13. Slackware 3.0 and wu-ftpd anonymous login fails to list directories or files