Sponsored Content
Top Forums Shell Programming and Scripting grep'ing for specific directories, and using the output to move files Post 302265223 by Christoph Spohr on Saturday 6th of December 2008 02:37:27 AM
Old 12-06-2008
Hi,

if i understand you correctly your commands will result in a file
consisting for directory names line by line? If this is so, try:

Code:
while read clients
do
  cp /data/new/* /var/tmp/"$clients"/inbound
done < clients

If my assumption is wrong, please post an example of your clients-file
and the files to be copied.

HTH Chris
 

9 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

grep'ing for text within a bunch of files...?

I have, say, a dozen files, and I want to grep for a string of text within them. I don't remember the exact syntax, but let me give it a shot and show you an idea here... find . -type f -exec grep thisword {} \; ...and there's a way to put more than one grep into the statement, so it will tell... (1 Reply)
Discussion started by: kitykity
1 Replies

2. Shell Programming and Scripting

grep'ing and sed'ing chunks in bash... need help on speeding up a log parser.

I have a file that is 20 - 80+ MB in size that is a certain type of log file. It logs one of our processes and this process is multi-threaded. Therefore the log file is kind of a mess. Here's an example: The logfile looks like: "DATE TIME - THREAD ID - Details", and a new file is created... (4 Replies)
Discussion started by: elinenbe
4 Replies

3. Shell Programming and Scripting

pipe'ing grep output to awk

This script is supposed to find out if tomcat is running or not. #!/bin/sh if netstat -a | grep `grep ${1}: /tomcat/bases | awk -F: '{print $3}'` > /dev/null then echo Tomcat for $1 running else echo Tomcat for $1 NOT running fi the /tomcat/bases is a file that... (2 Replies)
Discussion started by: ziggy25
2 Replies

4. UNIX for Dummies Questions & Answers

want to move files in a dir into different directories based on the filename

I want to move the files in a dir to different dirs based on their file names. Ex: i have 4 different files with name - CTS_NONE_10476031_MRL_PFT20081215a.txt CTS_NONE_10633009_MRL_PFT20091020a.txt CTS_NONE_10345673_MRL_PFT20081215a.txt CTS_NONE_10872456_MRL_PFT20091020a.txt and the 1st... (2 Replies)
Discussion started by: Sriranga
2 Replies

5. Shell Programming and Scripting

Loop to move files in different directories

Hi, I have various log files in different paths. e.g. a/b/c/d/e/server.log a/b/c/d/f/server.log a/b/c/d/g/server.log a/b/c/h/e/server.log a/b/c/h/f/server.log a/b/c/h/g/server.log a/b/c/i/e/server.log a/b/c/i/e/server.log a/b/c/i/e/server.log and above these have an archive folder... (6 Replies)
Discussion started by: acc01
6 Replies

6. Shell Programming and Scripting

Recursively move directories along with files/specific files

I would like to transfer all files ending with .log from /tmp and to /tmp/archive (using find ) The directory structure looks like :- /tmp a.log b.log c.log /abcd d.log e.log When I tried the following command , it movies all the log files... (8 Replies)
Discussion started by: frintocf
8 Replies

7. UNIX for Dummies Questions & Answers

Move multipe files to corresponding directories

Hi, In a parent directory there are several files in the form IDENTIFIER1x IDENTIFIER1.yyy IDENTIFIER1_Z, etc IDENTIFIER2x IDENTIFIER2.yyy IDENTIFIER2_Z, etc IDENTIFIER3x IDENTIFIER3.yyy, IDENTIFIER3_Z, etcIn the same parent directory there are corresponding directories named... (7 Replies)
Discussion started by: spirospap
7 Replies

8. Shell Programming and Scripting

Running program and output files in specific directories

I have been running a program mseed2sac using the following command cd IV find . -type f -exec /swadmin/mseed2sac '{}' \; The problem is that I end up with a lot of files in directory IV. Instead I would like to select the designator HHZ, create a directory IV.SAC and all the files output... (11 Replies)
Discussion started by: kristinu
11 Replies

9. UNIX for Beginners Questions & Answers

Move several files into specific directories with a loop

Hello, I'm a first time poster looking for help in scripting a task in my daily routine. I am new in unix but i am attracted to its use as a mac user. Bear with me... I have several files (20) that I manually drag via the mouse into several named directories over a network. I've used rsync... (14 Replies)
Discussion started by: SonnyClark
14 Replies
SOBBY(1)						      General Commands Manual							  SOBBY(1)

NAME
sobby - a dedicated server for collaborative editing SYNOPSIS
sobby [options] [session file] DESCRIPTION
sobby is a dedicated server which allows clients to edit plain text documents and source files collaboratively over a network. Changes to the documents are synchronised instantly to the other clients. OPTIONS
This program follows the usual GNU command line syntax, with long options starting with two dashes (`-'). A summary of available options is included below. -?, --help Show help options -n, --name=NAME Published server name -i, --interactive Show prompt to enter commands at runtime -p, --port=PORT Port which should be used to listen for clients --password=PASSWORD Global password required to join the session -c, --configfile=FILE Use the settings specified in the given configuration file --write-configfile=FILE Write the settings passed on the command line to the specified configuration file and exit --autosave-file=FILE File where to store autosaved sessions --autosave-interval=INTERVAL Interval (in seconds) between autosaves, 0 disables them; the presence of --autosave-directory automatically disables this option --autosave-directory=DIRECTORY Directory where to autosave all individual files of a session session file File to restore the session from, together with all documents stored therein and changes attributed to the corresponding users. AUTHOR
sobby was written by the 0x539 dev group <crew@0x539.de>. August 17, 2006 SOBBY(1)
All times are GMT -4. The time now is 09:02 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy