# This script is used to copy an object to the shared folder in the Ubuntu environment # contiki_Share is the name of the shared folder #! /Bin/sh # function: cpafile (suchasxx. hex) to/mnt/hgfs/contiki_Sharethatistheshareddirectory # betweenxpandvmwareubuntu # filename: f
# This script is used to copy an object to a shared folder in the Ubuntu environment.
# Contiki_Share is the name of the shared folder.
#! /Bin/sh
# Function: cp a file (such as xx. hex) to/mnt/hgfs/contiki_Share that is the shared directory
# Between xp and vmware ubuntu
# File name: file_cp.sh
# Date: 2012-07-29
# Example:
# Usage: file_cp.sh file_name
# Parameter detection; check whether it is a parameter (the parameter is the object to be copied)
If [$ #-ne 1]
Then
Echo "ERROR: there mush be one parameter"
Exit
Fi
# Dir detection;
# Shared directory Detection: used to check whether a shared directory exists in ubuntu. If no shared directory exists, it is mounted.
If [-d/mnt/hgfs/contiki_Share]
Then
Echo "dir contiki_Share exist"
Else
Sudo mount-t vmhgfs. host: // mnt/hgfs
Fi
Echo "$1"
Sudo cp./"$1"/mnt/hgfs/contiki_Share/
Echo "$1 has been copied to/mnt/hgfs/contiki_Share /"
# Note: To run the script, you must run it with the superuser permission.