Sponsored Content
Homework and Emergencies Homework & Coursework Questions Linux copy directory without using cp -r or any variant Post 302892670 by Wolverine89 on Friday 14th of March 2014 04:14:18 AM
Old 03-14-2014
Linux copy directory without using cp -r or any variant

Hi guys,

I need a solution to copy files and folders without using cp-r , cp-R or any variants. So i need to code it manually. I allready have a loop

Avans Highschool Breda the Netherlands

Code:
#!bin/bash

IFS=$'\n'

if test "$1" = "" 
then
        wd=pwd
else
        wd=$1 
fi

for file in $(find $1)
do    
        if [ -f $file ]; then
                cp $file ~/Desktop 
        elif [ -d $file ]; then
                 #copy directory,subdirectory and files wihtout
                 #using cp-r, cp-R or any variant
        fi
done

 

9 More Discussions You Might Find Interesting

1. UNIX Desktop Questions & Answers

Please help - System V Release 4 Variant

Sorry for this newbie question, but what exactly is Unix system V release 4 variant, and where do I download or buy this edition? There is alot of Unix info on the web, but the specifics can be a bit diverse. sorry (1 Reply)
Discussion started by: tropophyte
1 Replies

2. Linux

Where Can I Find the ar Archiver BSD Variant

I've been trying to get my hands on the source for the BSD variant of the ar archiver, but have not been able to find it anywhere. Does anyone know where I can get it? (3 Replies)
Discussion started by: Deluge
3 Replies

3. Shell Programming and Scripting

Copy Last modified directory to another directory

Hi, I have to copy last modified Directory to another directory.How can i Do using pipe or redirect cp -R 'ls -lrt|tail -1' test is not working. please help. (3 Replies)
Discussion started by: shaveta
3 Replies

4. UNIX for Dummies Questions & Answers

Copy directory from Linux to Windows

Hola a todos, soy realmente nuevo programando en bash, y aśn estoy encontrando bastantes baches :o, mi pregunta es simple, supongo, alguien podria decirme si existe una manera facil de copiar un directorio de un server a otro?, sucede que en un server(server1) tengo los backup de las bases de... (7 Replies)
Discussion started by: yeestrada
7 Replies

5. Linux

BSD Variant of ar (The Archiver)

A while back I posted about trying to find the BSD version of ar (The Archiver): https://www.unix.com/linux/136258-where-can-i-find-ar-archiver-bsd-variant.html I was given a link to the source, found here: ftp://ftp.freebsd.org/pub/FreeBSD/ports/distfiles/ar-20080302.tgz I recently was able... (0 Replies)
Discussion started by: Deluge
0 Replies

6. Shell Programming and Scripting

how to copy the directory but not copy certain file

Hi experts cp bin root src /mnt but not copy bin/bigfile any help? ( I post this thread in the "redhat" forum wrongly, I don't know how to withdraw that question in that wrong forum) Thanks (6 Replies)
Discussion started by: yanglei_fage
6 Replies

7. Shell Programming and Scripting

Copy the files in directory and sub folders as it is to another directory.

How to copy files from one directory to another directory with the subfolders copied. If i have folder1/sub1/sub2/* it needs to copy files to folder2/sub1/sub2/*. I do not want to create sub folders in folder2. Can copy command create them automatically? I tried cp -a and cp -R but did... (4 Replies)
Discussion started by: santosh2626
4 Replies

8. Post Here to Contact Site Administrators and Moderators

How to count successfully copy files source to target location with check directory in Linux?

Hi guys...please any one help me .... how to copy files from source to target location if 5 files copied successfully out of 10 files then implement success=10 and if remaining 5 files not copied successfully then count error=5 how to implement this condition with in loop i need code linux... (0 Replies)
Discussion started by: sravanreddy
0 Replies

9. Debian

Which older version and variant ISO image should I use?

Which older version and variant of Debian Linux ISO image should I use? I attempted to install two versions of Debian Linux Operating System onto my older full tower computer. First version, V8.5.0, Amd64, xfce, 32Bit. Second version V7.11.0, i386, 32Bit. When trying to install... (1 Reply)
Discussion started by: Jefferyab6
1 Replies
glib-gettextize(1)                                                 User Commands                                                glib-gettextize(1)

NAME
glib-gettextize - maintain the internationalization of a package that uses the GNU gettext command SYNOPSIS
glib-gettextize [--copy ] [--force ] [package-directory] DESCRIPTION
glib-gettextize copies several standard files into the specified package. These files must be included in every package that uses the GNU gettext command. glib-gettextize should only be used when creating a GNOME application. OPTIONS
The following options are supported: --copy Copy the files instead of creating symbolic links. You can also use -c to specify this option. --force Force new files to be created even if old versions of the files exist. You can also use -f to specify this option. OPERANDS
The following operands are supported: -package-directoSpecify the package directory in which glib-gettextize should run. If no directory is specified, glib-gettextize runs in the current directory. EXAMPLES
Example 1: Set Up the Internationalization Framework for a Package example% glib-gettextize In this example, glib-gettextize is run in the package base directory. ENVIRONMENT VARIABLES
See environ(5) for descriptions of the following environment variables that affect the execution of glib-gettextize: NLSPATH. EXIT STATUS
The following exit values are returned: 0 Application exited successfully >0 Application exited with failure FILES
The following files are used by this application: /usr/bin/glib-gettextizeThe command-line executable for the application. ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Availability |SUNWgnome-base-libs-share | +-----------------------------+-----------------------------+ |Interface stability |Evolving | +-----------------------------+-----------------------------+ SEE ALSO
gettext(1) Latest version of the GNOME Desktop User Guide for your platform. NOTES
Written by Erwann Chenede, Sun Microsystems Inc., 2003. SunOS 5.10 2 Oct 2003 glib-gettextize(1)
All times are GMT -4. The time now is 03:12 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy