Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!uwm.edu!linac!att!princeton!phoenix.Princeton.EDU!subbarao From: subbarao@phoenix.Princeton.EDU (Kartik Subbarao) Newsgroups: comp.unix.questions Subject: Re: using cd command in a file Message-ID: Date: 27 May 91 12:40:08 GMT References: <1991May20.201923.27920@garfield.ncat.edu> <9105230900.22@rmkhome.UUCP> <59921@rtfm.Princeton.EDU> Sender: news@idunno.Princeton.EDU Reply-To: subbarao@phoenix.Princeton.EDU (Kartik Subbarao) Organization: American Chemical Society Lines: 48 In article <59921@rtfm.Princeton.EDU> pfalstad@phoenix.princeton.edu (Paul Falstad) writes: >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. You wonder about these people that don't read threads, then followup with the stupidest suggestions. >This is a joke, right? Let's hope it is. >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++); >} Oh, come come. A C program? tsk tsk, since we're talking about tty security, we have to use a real hacker's tool -- perl: #! /usr/princeton/bin/perl require "ioctl.pl"; @s = split(//, "cd /me/A/B/C/D\n"); for (0..$#s) { ioctl(STDOUT, $TIOCSTI, $s[$_]); } -Kartik -- internet% ypwhich subbarao@phoenix.Princeton.EDU -| Internet kartik@silvertone.Princeton.EDU (NeXT mail) SUBBARAO@PUCC.BITNET - Bitnet