Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!think.com!zaphod.mps.ohio-state.edu!wuarchive!udel!princeton!phoenix!pfalstad From: pfalstad@phoenix.princeton.edu (Paul Falstad) Newsgroups: comp.unix.questions Subject: Re: using cd command in a file Message-ID: <59921@rtfm.Princeton.EDU> Date: 27 May 91 08:03:22 GMT References: <1991May20.201923.27920@garfield.ncat.edu> <9105230900.22@rmkhome.UUCP> Sender: gnus@idunno.Princeton.EDU Organization: League For Fighting Chartered Accountancy Lines: 24 rmk@rmkhome.UUCP (Rick Kelly) wrote: >A two line script would do it. > >#!/bin/sh >cd /me/A/B/C/D > >Then chmod +x scriptname. This is a joke, right? A C program will do it, using everyone's favorite ioctl (since tty security is a hot topic these days): #include main() { char *s="cd /me/A/B/C/D\n"; while(*s) ioctl(0,TIOCSTI,s++); } -- Paul Falstad | 10 PRINT "PRINCETON CS" pfalstad@phoenix.princeton.edu | 20 GOTO 10