NYCPHP Meetup

NYPHP.org

[nycphp-talk] [OT] Calling All Shell Scripters!

Phillip Powell phillip.powell at adnet-sys.com
Fri Oct 8 11:04:14 EDT 2004


I know you know Shell Script, you're all LAMP demigods out there, so I'm 
not surprised you dream in Shell Script as well.  In any case, I need 
some help with a very simple function I wrote for a command-line 
PHP-based application program migrator I wrote:

# SYNTAX: delete_tar $folderPath $origFolderName $today
delete_tar()
{
 echo "Are you sure you want to delete TAR file ""$1/${2}_${3}.tar.gz""? 
(Y/N Enter = N) "; read isOKDelete
 if [ $isOKDelete = "Y" -o $isOKDelete = "y" ]; then
  rm $1/${2}_${3}.tar.gz
 fi
}

------------------------------
--------------------------------------------------

I  continually get the "too many arguments" error on the "if" line if I 
do not enter either "Y" or "y".

[Quote]
/home/me/scripts/icatalog_unpackager.sh: [: too many arguments
[me at www me]$
[/Quote]

As dumb as this is going to sound, how must I do this correctly?  I have 
already gone to Linux Shell Script tutorials and apparently am not 
grasping this.

Thanx
Phil

-- 
---------------------------------------------------------------------------------
Phil Powell
Multimedia Programmer
BPX Technologies, Inc.
#: (703) 709-7218 x107 
Fax: (703) 709-7219

	




More information about the talk mailing list