shell-script-pt
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [shell-script] Bash script para pegar as fotos de um diretório e cri


From: Felipe Kellermann
Subject: Re: [shell-script] Bash script para pegar as fotos de um diretório e criar um arquivo html com os links
Date: Mon, 20 Feb 2006 22:10:14 -0300 (BRT)
User-agent: Pine <http://www.washington.edu/pine/>

On Fri, 17 Feb 2006 2:04pm  -0200, Fernando Zank wrote:

> #!/bin/bash
> 
> rm -f index.html
> 
> for x in `ls -1 | grep -i jpg`; do
>     echo "<a href='$x'>$x</a><br>" >> index.html;
> done;

Para complementar. Em zsh poderia ser assim

  printf "<a href=\"%s\">%s</a>\n" *.jpg(e:'reply=(${REPLY}{,})':)


E em qualquer outro shell (bash, ksh, etc), poderia ser assim, um pouco 
menos bonito

  for i in *.jpg; { printf "<a href=\"%s\">%s</a>\n" "$i" "$i"; }

-- 
Felipe Kellermann


reply via email to

[Prev in Thread] Current Thread [Next in Thread]