From owner-freebsd-questions Mon Dec 14 23:14:53 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id XAA23461 for freebsd-questions-outgoing; Mon, 14 Dec 1998 23:14:53 -0800 (PST) (envelope-from owner-freebsd-questions@FreeBSD.ORG) Received: from cc942873-a.ewndsr1.nj.home.com (cc942873-a.ewndsr1.nj.home.com [24.2.89.207]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id XAA23447 for ; Mon, 14 Dec 1998 23:14:48 -0800 (PST) (envelope-from cjc@cc942873-a.ewndsr1.nj.home.com) Received: (from cjc@localhost) by cc942873-a.ewndsr1.nj.home.com (8.8.8/8.8.8) id CAA10678; Tue, 15 Dec 1998 02:15:20 -0500 (EST) (envelope-from cjc) From: "Crist J. Clark" Message-Id: <199812150715.CAA10678@cc942873-a.ewndsr1.nj.home.com> Subject: Re: Two Questions In-Reply-To: <199812150423.XAA12491@integral.on.ca> from David Empey at "Dec 14, 98 11:23:59 pm" To: empey@integral.on.ca (David Empey) Date: Tue, 15 Dec 1998 02:15:20 -0500 (EST) Cc: freebsd-questions@FreeBSD.ORG Reply-To: cjclark@home.com X-Mailer: ELM [version 2.4ME+ PL40 (25)] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG David Empey wrote, > First, I need to be able to change the extension on a large number of files > in a directory from *.txt to *.ltr, but I cannot seem to get the mv (or > the cp and rm) commands to do the job. Is there something easier to do > than renaming the files one by one? Depends on the shell you are using. If you are using csh or tcsh, type at the command prompt, % foreach file ( *.txt ) foreach? mv $file ${file:r}.ltr foreach? end Where '%' and 'foreach?' will be the prompts you get. Easy to move that to a script form. See 'man csh' or the shell of your choice. > Second, I'm writing a shell script to take input for the 'at' command. > Using 'read' to get input for the time and day are no problem, but I'm > having trouble devising a way to get a list of commands to run. What I > have in mind is this: read in variables for time and day, run the at > command (from a script) with the time and place as arguments. However, > what I need is a way to get the script to get a list of commands from the > user, or else perhaps a way to run the command (from the script) so that it > gives the user a chance to input a list of commands as would be the case if > it was run from the command line. > > Any suggestions appreciated, with thanks! Ummm... It sounds like you are trying to make a command to be a front end for 'at' that takes the exact same inputs as 'at...' Why not use 'at' in the first place and skip the extra step? -- Crist J. Clark cjclark@home.com To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message