PDA

View Full Version : very veryurgent..shell script needed...assignment tommrrow is last date of submission



Avikal
April 3rd, 2008, 11:21 AM
plz help..................tommrrow final day ...other wise will flunk....see the attachment

CptPicard
April 3rd, 2008, 11:48 AM
http://ubuntuforums.org/showthread.php?t=717011

ghostdog74
April 3rd, 2008, 12:57 PM
i will not do your homework..however, i can at least provide you some guidance. If you click at the Learn Bash Scripting link in my sig, you can go to this page (http://tldp.org/LDP/abs/html/parameter-substitution.html#VARMATCH)to see how you can get the first part of the file before the extension
next you can go to see Simple for loops (http://tldp.org/LDP/abs/html/loops1.html#EX22) where you can use it to loop through your files one by one. To unpack files, read the man page of tar command.

sekinto
April 3rd, 2008, 01:12 PM
I sent you a message how to do it in Python, of course you have to custom fit the code to the types of archives you will be extracting. Please look over the code and learn from it.

Avikal
April 3rd, 2008, 01:19 PM
help plz......i kno ur policies......was enrollled 3 days back n now the assignment....plz:confused:

pedro_orange
April 3rd, 2008, 01:33 PM
We don't do homework.

I just did a google, and found a script you can use to get you 55% with a bit of tweaking. Have you heard of google?
www.google.com

The remainder of the assignment is only a little extra tweaking. This could be done in 30 minutes if you put your mind to it.

Wybiral
April 3rd, 2008, 01:37 PM
http://ubuntuforums.org/customavatars/avatar148462_3.gif

=D>

Siph0n
April 3rd, 2008, 03:08 PM
I love these threads :) Very urgent, homework is due!!! :) You know the policies of the forum, yet u still wanna go against them? ... It looks like you didn't even try the problem... Have you?

CptPicard
April 3rd, 2008, 03:11 PM
Yeah, well, you know, I've got this WORK assignment due like yesterday, and my boss is breathing down my neck... plz do it for me!!1 HELP

pedro_orange
April 3rd, 2008, 03:19 PM
Yeah, well, you know, I've got this WORK assignment due like yesterday, and my boss is breathing down my neck... plz do it for me!!1 HELP

Spend less time on these forums & more time in debug!

brennydoogles
April 3rd, 2008, 03:26 PM
help plz......i kno ur policies......was enrollled 3 days back n now the assignment....plz:confused:

How long ago was the project assigned? Have you written any code for it yet? If you would be willing to post evidence that you have tried ANYTHING, people might be willing to help save your rear. Until then, I fear you may be SOL.

Bruce M.
April 3rd, 2008, 09:35 PM
i will not do your homework

Good for you. :)

And a HUGE Thank You for the links in your sig for bash scripting.

New to Linux and just stretching my wings with bashrc aliases and stuff. I hope that link helps. :)

Have a nice day
Bruce

CptPicard
April 3rd, 2008, 09:37 PM
Yeah, actually, thanks as well. I would have been stumped (without researching of course) at how to strip the file extension...

Avikal
April 5th, 2008, 04:29 PM
dir=`pwd`
mkdir archive_store
ls -lrt | grep .tar | awk '{ print $9 }' > tmp.txt
for file_names in `cat tmp.txt`
do
cd $dir
len=`echo $file_names |wc -c`
name_len=`expr $len - 5`
mkdir `echo ${file_names:0:$name_len}`
mv $file_names `echo ${file_names:0:$name_len}`
cd `echo ${file_names:0:$name_len}`
tar -xvf $file_names
mv $file_names ../archive_store
done
cd $dir;rm tmp.txt

aysiu
April 5th, 2008, 04:36 PM
Yeah, as people have mentioned, it's up to you to do your own homework. People have also been kind enough to post guidance on where to go from here. So, with that, I'm closing this thread.