note 77213 added to language.operators.execution

From: Date: Mon, 20 Aug 2007 14:44:18 +0000
Subject: note 77213 added to language.operators.execution
Groups: php.notes 
Request: Send a blank email to php-notes+get-129642@lists.php.net to get a copy of this message
Using a backtick script on Linux to make a little directory lister/linker: <?php $output = ls -1|fgrep -v index.php |awk '{ print "<a href=" $1 ">" $1 "</a>" }'; echo "<pre>$output</pre>"; ?> Save as index.php with whatever HTML formatting you desire. Then, to put this script in the subdirs for recursive listing/linking, do this at the command line: # find . -mindepth 2 -type d -exec ln index.php {}/ \; Of course, I'm assuming there is not already a "index.php" file in the subdirs. A break down of the command line in the backticks: * ls -1 # list one file per line (note, not "ls -l") * fgrep -v index.php # exclude the index page * awk ... # grab each line from ls -1 and wrap with A HREF tags Have fun! ---- Server IP: 64.71.164.2 Probable Submitter: 64.39.0.38 ---- Manual Page -- http://www.php.net/manual/en/language.operators.execution.php Edit -- https://master.php.net/note/edit/77213 Del: integrated -- https://master.php.net/note/delete/77213/integrated Del: useless -- https://master.php.net/note/delete/77213/useless Del: bad code -- https://master.php.net/note/delete/77213/bad+code Del: spam -- https://master.php.net/note/delete/77213/spam Del: non-english -- https://master.php.net/note/delete/77213/non-english Del: in docs -- https://master.php.net/note/delete/77213/in+docs Del: other reasons-- https://master.php.net/note/delete/77213 Reject -- https://master.php.net/note/reject/77213 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#129642) next »