Sponsored Content
Top Forums Shell Programming and Scripting Copying files excluding some files Post 302702307 by RudiC on Tuesday 18th of September 2012 05:47:22 AM
Old 09-18-2012
Not sure if this can be done with a smart usage of shell's pathname expansion/globbing (btw, what shell?); put this into a script:
Code:
for (( i=1+10#${1#*\.}; i<10#${2#*\.}; i++)) ; do cp -f $(printf "%s.%06d" ${1%\.*} $i) targetdir; done

and execute with bash.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Excluding Old Files on AWK !!!

People, I'm sorry because my english is not very good, I'm from Brazil and I need to create shell script that exclude old files. How can I do this? I have an AWK script that works for Unix TRU64 (DIGITAL) and the same script does not work for SUN SOLARIS 5.8. Follows the script fragment: ... (2 Replies)
Discussion started by: alexalvarenga
2 Replies

2. Shell Programming and Scripting

search for files excluding binary files

Hi All, I need a solution on my following find command find ./.. -name '*.file' -print BTW This gives me the output as belows ./rtlsim/test/ADCONV0/infile/ad0_dagctst.file ./rtlsim/test/ADCONV0/user_command.file ./rtlsim/test/ADCONV0/simv.daidir/scsim.db.dir/scsim.db.file... (2 Replies)
Discussion started by: user_prady
2 Replies

3. UNIX for Advanced & Expert Users

listing files excluding files from control file

I have a directory named Project.I have a control file which contains valid list of files.I would like list the files from directory Project which contains files other than listed in the control file. Sample control file: TEST SEND SFFFILE CONTL The directory contains followign... (15 Replies)
Discussion started by: ukatru
15 Replies

4. UNIX for Advanced & Expert Users

copying of files by userB, dir & files owned by userA

I am userB and have a dir /temp1 This dir is owned by me. How do I recursively copy files from another users's dir userA? I need to preserve the original user who created files, original group information, original create date, mod date etc. I tried cp -pr /home/userA/* . ... (2 Replies)
Discussion started by: Hangman2
2 Replies

5. Shell Programming and Scripting

cp -Rp excluding certain files?

Hi, I'm using cp -Rp to copy directories while preserving permissions. I want to exclude any ".lproj" files except for "English.lproj" and "en.lproj" from being copied, but the rest is copied as usual. Is there a way to do this (without using tar or other compression utilities) Thanks (3 Replies)
Discussion started by: pcwiz
3 Replies

6. UNIX for Dummies Questions & Answers

Count number of files in directory excluding existing files

Hi, Please let me know how to find out number of files in a directory excluding existing files..The existing file format will be unknown..each time.. Thanks (3 Replies)
Discussion started by: ammu
3 Replies

7. Shell Programming and Scripting

Files copying - [ Listed files alone. ] - Shell script

Hi All, I am doing this for svn patch making. I got the list of files to make the patch. I have the list in a file with path of all the files. To Do From Directory : /myproject/MainDir To Directory : /myproject/data List of files need to copy is in the file: /myproject/filesList.txt ... (4 Replies)
Discussion started by: linuxadmin
4 Replies

8. UNIX for Advanced & Expert Users

Copying excluding some files and folders

I have a main folder. Inside that i have many(50) subfolders. In each subfolder, there are a no of large files(500 files ) present. I want to do copy operation for some files from some of the subfolders to /usr/tmp. I have the list of the subfolders and list of of files which i dont want to... (4 Replies)
Discussion started by: millan
4 Replies

9. UNIX for Advanced & Expert Users

Find all files in the current directory excluding hidden files and directories

Find all files in the current directory only excluding hidden directories and files. For the below command, though it's not deleting hidden files.. it is traversing through the hidden directories and listing normal which should be avoided. `find . \( ! -name ".*" -prune \) -mtime +${n_days}... (7 Replies)
Discussion started by: ksailesh1
7 Replies

10. Shell Programming and Scripting

Append string to all the files inside a directory excluding subdirectories and .zip files

Hii, Could someone help me to append string to the starting of all the filenames inside a directory but it should exclude .zip files and subdirectories. Eg. file1: test1.log file2: test2.log file3 test.zip After running the script file1: string_test1.log file2: string_test2.log file3:... (4 Replies)
Discussion started by: Ravi Kishore
4 Replies
YASH(1) 						      General Commands Manual							   YASH(1)

NAME
yash - Yet Another Shell SYNOPSIS
yash [options] [filename [args...]] yash [options] -c command [command_name [args...]] yash [options] -s [args...] DESCRIPTION
yash is a command line shell that conforms to the POSIX.1 (IEEE Std 1003.1, 2008 Edition) standard for the most part. Actually, it is much more POSIX-compliant than other shell like bash and zsh. yash also has its own features beyond POSIX, such as: * global aliases * random numbers * socket redirections and other special redirections * right prompt * command completion OPTIONS
set - set shell options and positional parameters set [-abefhmnuvxC] [+abefhmnuvxC] [-o option] [+o option] [--] [arg...] set -o set +o The first form enables or disables the specified shell options and/or sets positional parameters to <arg>s. If no <arg>s are given, the positional parameters are not changed. If no options or <arg>s are given at all, a list of all existing variables is printed. To clear all positional parameters, use `set --'. The second form prints the current settings of the shell options in a human- readable form. The third form prints commands that can be used to restore the current option settings later. -h, --help Show this help message and exit -a --allexport Any variable is exported when assigned. -b --notify When the status of a job is changed, it is notified immediately. --notifyle Similar to -b, but only notify during line-editing. Ignored if -b is set. -e --errexit Exit the shell immediately when any simple command returns a non-zero status. +f --glob Perform pathname expansion (globbing). --caseglob Perform pathname expansion case-sensitively. --dotglob In pathname expansion, `*' and `?' match a `.' at the beginning of the filename. --markdirs In pathname expansion, directory pathnames have a `/' at the ends. --extendedglob Enable extended pathname expansion. --nullglob In pathname expansion, patterns that do not match any pathname are removed from the command line rather than left as is. -h --hashondef When a function is defined, all the commands in the function are registered in the command path cache. -m --monitor Enable job control. All jobs are run in their own process group. When the status of a job is changed, the status is reported before the next prompt. This option is enabled by default for an interactive shell. +n --exec Execute commands. This option cannot be disabled in an interactive shell. +u --unset Expand an undefined variable to an empty string. -v --verbose Echo each command to the standard error before execution. -x --xtrace After each command line is expanded, the expanded line is printed to the standard error. +C --clobber Allow redirections to overwrite existing files. --ignoreeof Do not exit when an EOF is entered. This option is effective in an interactive shell only. --braceexpand Enable brace expansion. --curasync, --curbg, --curstop A background job becomes the current job when (curasync) invoked as an asynchronous command (curbg) resumed by the bg built-in (curstop) stopped. (These options are enabled by default) --histspace Do not save lines that start with a space in the history. --posixly-correct Make the shell behave as the POSIX shell. --vi Enable vi-like editing. --emacs Enable emacs-like editing. --le-convmeta Treat 8th bit of input as a meta-key flag (regardless of terminfo). --le-noconvmeta Do not treat 8th bit of input as a meta-key flag. --le-visiblebell Alert with a flash rather than a bell. --le-promptsp Move cursor to beginning of line each time when starting line-editing. (enabled by default) --le-alwaysrp Make the right prompt always visible on the screen. --le-compdebug Print debugging information during command line completion. Options can be disabled by using `+' instead of `-'. For example, `set +a' or `set ++allexport' disables the allexport option. Prefixing `no' to a long option also disables the option. For example, `set --nounset' disables the unset option. AUTHOR
yash was written by Magicant <magicant@users.sourceforge.jp>. This manual page was written by Khalid El Fathi <khalid@elfathi.fr>, for the Debian project (and may be used by others). May 17, 2012 YASH(1)
All times are GMT -4. The time now is 06:08 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy