Quick Favour needed


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Quick Favour needed
# 1  
Old 07-27-2009
Quick Favour needed

Hi there, i currently dont have access to my linux machine and need to get these script files sent to someone. Can someone please create .sh files for me with the code that i have displayed below. It would be very very helpfull.

There are 3 different scripts and it would be great if someone could put them in .sh files and send them to me. Thanks in advance! xx

Code:
#Delete script
#
dustbin=/home/08012109/unix/dustbin
  # making a varible for the dustbin so I don't repeatedly have to type out the full path
  if [ -d $dustbin ]; then
  echo "Dustbin found"
  else
  echo "Creating  Dustbin"
  mkdir $dustbin
  fi
  #
  # if dustbin doesn't exist mkdir dustbin.
   
  if [ -f $1 ]; then
  echo "file found"
  echo "$1 moved to dustbin"
  else
  echo "file not found"
  echo "can't move $1 to dustbin"
  fi
  #
  # Validating file exists
  mv $1 $dustbin
  #
  # 'deleting' file by simply moving it to dustbin.
   
   
  exit 0
   
  # end of script



Code:
# restore script
#
  case "$1" in
  -n)
  echo where do want the file to be moved to?
  read loc
  echo moving file $2 to $loc....
  mv dustbin/$2 $loc
  ;;
  *)
  echo moving file $1 to 08012109/linux...
  mv dustbin/$1 /home/08012109/linux
  ;;
  esac

Code:
# Trash script
#
#
if [ -d dustbin ]; then
echo "dustbin found"
else
echo "there's no dustbin to empty"
exit 0
fi
#
#if dustbin doesn't exist throw error 'there's no dustbin to empty'

case "$1" in

-a)
if (test -z "$(ls dustbin)" );
  then
 echo "bin already empty"
  else
rm dustbin/*
echo dustbin emptied
fi
#
#bin emptied
;;
-i)
echo "-i chosen"
;;
-ai)

if (test -z "$(ls dustbin)" );
  then
 echo "bin already empty"
  else
rm -irv dustbin/*
fi

;;
*)
echo "chosen nothing"
;;
esac
#
# use a case statement for each of the options and also one for the combination of options. -i and regular versions not working correctly

# 2  
Old 07-27-2009
Um, sorry if this is a silly question, but why don't you just email what you posted here to that person?
# 3  
Old 07-27-2009
Post heading is not suggesting useful.

The question seems to be something that you could do it yourselves. If you don't have access to any of the linux box, try getting an account from public unix servers which can be accessed from anywhere.
# 4  
Old 07-27-2009
Its just a quick favour i need someone to do. If no one wants to thats fine just dont post asking why or w/e if u dnt want to do it jst dnt post...... thanks anyway
Login or Register to Ask a Question

Previous Thread | Next Thread

8 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Quick help on 'awk' needed...!!

bash-2.05$ A=`cat /etc/group |awk -F':' '{if ($1$3$4 ==... (3 Replies)
Discussion started by: ak835
3 Replies

2. Shell Programming and Scripting

Notepad help needed easy quick question

TAKE A LOOK AT THE ATTACHED PICTURE. my goal is just to SELECT n DELETE Those lines : Dialogue: Marked=0,0:02:39.49,0:02:40.49,Default,NTP,0000,00 00,0000,!Effect, (without the text) take a look at that picture... the marked line... i just need ALL of these lines removed.. i managed... (3 Replies)
Discussion started by: mr_spidey
3 Replies

3. Solaris

Quick help!

Hi, iam trying to use lofiadm in solaris 5.10 but getting the following error.. bash-3.00# lofiadm -a /asmdisks/_file_disk1 lofiadm: /dev/lofictl: No such file or directory i dont see lofictl file in /dev .. i checked in other similar machines..i found this file..can i export this file from... (2 Replies)
Discussion started by: rags_s11
2 Replies

4. UNIX for Advanced & Expert Users

Guidance needed for quick script

Hi all, I am trying to get the exception count daily from a log file which is more than 1 GB in size. I am using loops which get the count of the exception and transaction. But i need to take this exception count for a time frame from 5.00 am to 5:00 pm. I Think I can use to exact the... (4 Replies)
Discussion started by: senthilkumar_ak
4 Replies

5. Shell Programming and Scripting

Quick help needed in the Shell Script

Hiii, i have a doubt here-- I have to take backup of all the files inside directory dir(logs,tmp,corefiles) at the location $BackupLocation.i should take the backup of logs,tmp,corefiles inside the $BackupLocation directory and then remove the files and touch the files inside the directory... (1 Reply)
Discussion started by: namishtiwari
1 Replies

6. Shell Programming and Scripting

Quick one

Hallo friends, I have a log file called xxx.log which is generated everymorning. I want to change this file to xxx_.log Please assist, i am using ksh on AIX. Ta, Pax (4 Replies)
Discussion started by: kekanap
4 Replies

7. IP Networking

IP Address changes - Quick Help Needed.

We are running Solaris 9 and I have changed the IP address, Subnet Mask & Broadcast Address using ifconfig and have also changed the default gateway. How do I save these changes as I have bounced the box and it reverted back to the old IP Address settings. I am really new to UNIX and we... (4 Replies)
Discussion started by: gingerd2003
4 Replies

8. UNIX for Dummies Questions & Answers

i need quick help???...please

hey guys i'm new in this world " unix " i wanna any websites can help me to learn unix or any websites i can download UNIX from it thanks :D (3 Replies)
Discussion started by: M_Hafez
3 Replies
Login or Register to Ask a Question