f



can you translate shell script into perl script?

hi~~~
first of all if you wanna do this. you should make a directory called
'.junk' in your home directory.
and then please translate this into perl script. the teacher said this
is so easy but I can't do this. but I'm trying to solve this. so would
you help me. below is the script which must be translated into.

----------------------------------------------------------------------------------------------------
fileCount=0
	listFlag=0
	purgeFlag=0
	fileFlag=0
	junk=~/.junk

	for arg in $*
	do
		case $arg in
		"-p")
		purgeFlag=1
		;;
		"-l")
		listFlag=1
		;;
		*)
		fileFlag=1
		fileList[$fileCount]=$arg
		let fileCount=fileCount+1
		;;
		esac
	done


	if (( listFlag == 1 ))
	then
		'ls' -lgF $junk
		exit 0
	fi

	if (( purgeFlag == 1 ))
	then
		'rm' $junk/*
		exit 0
	fi

	if (( fileFlag == 1 ))
	then
		'mv' ${fileList[*]} $junk
		exit 0
	fi


	exit 0
------------------------------------------------------------------------------------------

0
dondora
5/24/2006 7:14:39 AM
comp.unix.shell 15484 articles. 2 followers. Post Follow

1 Replies
640 Views

Similar Articles

[PageSpeed] 0

dondora wrote:
> hi~~~
> first of all if you wanna do this. you should make a directory called
> '.junk' in your home directory.
> and then please translate this into perl script. the teacher said this
> is so easy but I can't do this. but I'm trying to solve this. so would
> you help me. below is the script which must be translated into.

DO.

YOUR.

OWN.

HOMEWORK!!!!!
1
base60
5/24/2006 11:42:38 AM
Reply: