Pomoc - Szukaj - Użytkownicy - Kalendarz
Pełna wersja: [inne]Jak zrobić formatowanie tekstu w skrypcie bash?
Forum PHP.pl > Forum > Przedszkole
Saki
Witam, chce napisać mały skrypt do pobierania informacji o funkcji z strony php.net
Mam już bardzo prosty skrypt:

  1.  
  2. #!/bin/sh
  3. url=`lynx --dump http://$1.php.net/$2`
  4. echo $url




odpala się go w sposób sebastian@pc:~$ phpinfo pl echo
ładnie działa ale formatowanie tekstu brak, wiecie może jak zrobić aby ładnie pokazywał tekst?
Bo teraz wyświetla wszystko w jednej linii smile.gif
muk4
Albo sam formatuj tekst, albo zamiast -dump użyj -source i zamień <br /> na \n.
Saki
Cytat(muk4 @ 11.07.2011, 20:34:10 ) *
Albo sam formatuj tekst, albo zamiast -dump użyj -source i zamień <br /> na \n.



Ale, ale jak zmiennie na source to pokazuje mi cały kod źródłowy

sebastian@pc:/tmp$ phpinfo pl echo
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head profile="http://purl.org/NET/erdf/profile"> <title>PHP: echo - Manual</title> <style type="text/css" media="all"> @import url("/styles/site.css"); @import url("/styles/mirror.css"); </style> <!--[if IE]><![if gte IE 6]><![endif]--> <style type="text/css" media="print"> @import url("/styles/print.css"); </style> <!--[if IE]><![endif]><![endif]--> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> <link rel="shortcut icon" href="/favicon.ico" /> <link rel="contents" href="index.php" /> <link rel="index" href="ref.strings.php" /> <link rel="prev" href="function.crypt.php" /> <link rel="next" href="function.explode.php" /> <link rel="schema.dc" href="http://purl.org/dc/elements/1.1/" /> <link rel="schema.rdfs" href="http://www.w3.org/2000/01/rdf-schema#" /> <link rev="canonical" rel="self alternate shorter shorturl shortlink" href="http://php.net/echo" /> <link rel="license" href="http://creativecommons.org/licenses/by/3.0/" about="#content" /> <link rel="canonical" href="http://php.net/manual/en/function.echo.php" /> <script type="text/javascript" src="/userprefs.js"></script> <base href="http://pl.php.net/manual/en/function.echo.php" /> <meta http-equiv="Content-language" content="en" /> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs
To jest wersja lo-fi głównej zawartości. Aby zobaczyć pełną wersję z większą zawartością, obrazkami i formatowaniem proszę kliknij tutaj.
Invision Power Board © 2001-2025 Invision Power Services, Inc.