|
#1
| |||
| |||
| HOW TO: start your default web browser with one unix command
kind of silly i know, but i edit html in my term windows and i hate using a mouse to test in a browser. short version: -------------------------- 1. make an html page. (page.html) 2. write an executable shell script somewhere in your $PATH with the line "Open /path/to/page.html;". -------------------------- long version: -------------------------- fisrt create a nice little html page. mine looks like this.. PHP Code: now open a terminal and type "cd /usr/bin" then, using your favorite unix text editor create a file with the following line: Open /Users/yourname/mypage.html; you will have to run the editor as the super user (using sudo) because root owns /usr/bin. so for example "sudo pico zong". name the file something catchy and easy to type because the name of this file is gonna be the command you type to launch your browser. i used "zong". finally. once you've saved your new file and exited your editor. you need to type "sudo chmod a+x zong". now when you type "zong" at the command prompt it will launch your page in your default browser. -------------------------- |
|
#2
| ||||
| ||||
|
Umm...why would you write a shell script to do that? You could just type open /Users/yourname/mypage.html and it would work fine. Or are you just going for a one word command? I guess that's helpful....
__________________ I am but a lonely shadow, Doomed forever to roam and wander. But if you allow me to pause before I must go, I'll spin you tales of mystery and wonder. Site: Night Productions |
|
#3
| |||
| |||
|
Or you could setup your site (/Users/<you>/Site == http://localhost/~you. Create and index.html page and at its simplist create a list of all the pages you are createing with anchor links to them. Then work on your html files that are in ..../Sites/<optional subdirs>. This way you can use the html pages as if they are on a Web server (which they now are), rather than the reduced functionality you have when opening pages on the normal file system. For example, if you have php setup, you html, I mean php pages can contain PHP code and will work correctly, but won't if handled outside of the webserver. You also have access to the cgi-bin thru the Web Server. I hope that helps! Cheers, Brooke |
|
#4
| |||
| |||
|
And NEVER, NEVER (did I say NEVER) put your scripts in /usr/bin. Use ~/bin or /usr/local/bin for your stuff. I really makes it much easier to backup and restore if you know what is yours and what is owned by the system. Brian G. |
![]() |
| Bookmarks |
| Thread Tools | |
|
|
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Thank God the Witch Is Dead | Veljo | Mac OS X System & Mac Software | 2 | June 27th, 2003 06:51 PM |
| Browser Standards: Safari Web Browser | PXL Transmitter | Opinions, & Open Letters | 2 | January 15th, 2003 07:31 AM |
| Lock Omniweb as the default browser? | AlanBDahl | Mac OS X System & Mac Software | 5 | January 22nd, 2002 12:57 PM |
| UNIX related things... (tr, cut, awk, and permissions) | simX | Apple News, Rumors & Discussion | 5 | December 19th, 2001 03:33 AM |
| UNIX command line: where can I learn??? | Nachohat | Mac OS X System & Mac Software | 6 | July 25th, 2001 12:42 AM |