File copy script in Ubuntu and XP shared folder Mode

Source: Internet
Author: User
Tags superuser permission
# 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.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.