Sponsored Content
Full Discussion: moving only files...
Top Forums UNIX for Dummies Questions & Answers moving only files... Post 10651 by sskb on Monday 19th of November 2001 11:38:56 AM
Old 11-19-2001
moving only files...

hi.. I want to move a set of files that contain a particular string. I wished to do that with find but i am unable to do that. can anybody give me a good method?
Smilie
sskb
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

moving files ??

I am using AIX Version 5.1 If I moved a file say using this command but the directory rpt did not exist would this dump the file? I went back to the directory I was moving it from and the file was gone and when I looked in the directory I moved it to of course that directory was not found.... (9 Replies)
Discussion started by: rocker40
9 Replies

2. Shell Programming and Scripting

Moving Files

Hi There, I am trying to move files, the file is present in this location: /iAm4Free/test/generate/txt/information.txt I need to move it to: /iAm4Free/test1/generate/txt/information.txt The only difference is the "test" is replaced with "test1". But the constraint is. The parent... (5 Replies)
Discussion started by: iAm4Free
5 Replies

3. Shell Programming and Scripting

Moving files

I wrote a script which moves files on first in first out basis. for i in `ls -ltr | grep ^- | head -10 | awk '{print $9}'` do mv $i Test/ done But donno some reason, this is not working on my Linux box. May i know the reason? Can the above script be done by using positional... (2 Replies)
Discussion started by: venkatesht
2 Replies

4. UNIX for Dummies Questions & Answers

Moving files

Hi I need to be able to move files from one central locations to different servers on our network. So i want all of our operators to place files to one area on the main storage area. From there i need a script that first checks the file is stable (finished copying) then copy to another server,... (5 Replies)
Discussion started by: treds
5 Replies

5. Shell Programming and Scripting

moving the files in a.txt files to a different directory

HI All, I am coding a shell script which will pick all the .csv files in a particular directoryand write it in to a .txt file, this .txt file i will use as a source in datastage for processing. now after the processing is done I have to move and archive all the files in the .txt file to a... (5 Replies)
Discussion started by: subhasri_2020
5 Replies

6. UNIX for Dummies Questions & Answers

Moving Multiple files to destination files

I am running a code like this foreach list ($tmp) mv *_${list}.txt ${chart}_${list}.txt #mv: when moving multiple files, last argument must be a directory mv *_${list}.doc ${chart}_${list}.doc #mv: when moving multiple files, last argument must be a... (3 Replies)
Discussion started by: animesharma
3 Replies

7. Shell Programming and Scripting

Finding files with wc -l results = 1 then moving the files to another folder

Hi guys can you please help me with a script to find files with one row/1 line of content then move the file to another directory my script below runs but nothing happens to the files....Alternatively Ca I get a script to find the *.csv files with "wc -1" results = 1 then create a list of those... (5 Replies)
Discussion started by: Dj Moi
5 Replies

8. UNIX for Dummies Questions & Answers

Moving files..

Selected directories on our system generate alerts when they exceed 60% of the disk space so I have used gzip to make the files smaller on one of the directories in question (AdminServer logs). I want to move these to another directory what is the best way to make this happen? Thanks.. (4 Replies)
Discussion started by: nosuchluck
4 Replies

9. UNIX for Dummies Questions & Answers

Moving Files to VM

Hi guys, i need to test a script on my RedHat which it's mounted on a VirtualBox (oracle VM). So i need to copy a directory with subdirectories, from a remote host to my VM. I'd like to do that within cmd not with program like Filezilla or something like that. Any idea please? (4 Replies)
Discussion started by: Newer
4 Replies

10. AIX

Moving Hidden files to normal files

I have a bunch of hidden files in a directory in AIX. I would like to move these hidden files as regular files to another directory. Say i have the following files in directory /x .test~1234~567 .report~5678~123 .find~9876~576 i would like to move them to directory /y as test~1234~567... (10 Replies)
Discussion started by: umesh.narain
10 Replies
Dancer::Test(3pm)					User Contributed Perl Documentation					 Dancer::Test(3pm)

NAME
Dancer::Test - Test helpers to test a Dancer application SYNOPSYS
use strict; use warnings; use Test::More tests => 2; use MyWebApp; use Dancer::Test; response_status_is [GET => '/'], 200, "GET / is found"; response_content_like [GET => '/'], qr/hello, world/, "content looks good for /"; DESCRIPTION
This module provides test helpers for testing Dancer apps. Be careful, the module loading order in the example above is very important. Make sure to use "Dancer::Test" after importing the application package otherwise your appdir will be automatically set to "lib" and your test script won't be able to find views, conffiles and other application content. For all test methods, the first argument can be either an array ref of the method and route, or a scalar containing the route (in which case the method is assumed to be "GET"), or a Dancer::Response object. # all 3 are equivalent response_status_is [ GET => '/' ], 200, 'GET / status is ok'; response_status_is '/', 200, 'GET / status is ok'; my $resp = dancer_response GET => '/'; response_status_is $resp => 200, 'GET / status is ok'; METHODS
route_exists([$method, $path], $test_name) Asserts that the given request matches a route handler in Dancer's registry. route_exists [GET => '/'], "GET / is handled"; route_doesnt_exist([$method, $path], $test_name) Asserts that the given request does not match any route handler in Dancer's registry. route_doesnt_exist [GET => '/bogus_path'], "GET /bogus_path is not handled"; response_exists([$method, $path], $test_name) Asserts that a response is found for the given request (note that even though a route for that path might not exist, a response can be found during request processing, because of filters). response_exists [GET => '/path_that_gets_redirected_to_home'], "response found for unknown path"; response_doesnt_exist([$method, $path], $test_name) Asserts that no response is found when processing the given request. response_doesnt_exist [GET => '/unknown_path'], "response not found for unknown path"; response_status_is([$method, $path], $status, $test_name) Asserts that Dancer's response for the given request has a status equal to the one given. response_status_is [GET => '/'], 200, "response for GET / is 200"; response_status_isnt([$method, $path], $status, $test_name) Asserts that the status of Dancer's response is not equal to the one given. response_status_isnt [GET => '/'], 404, "response for GET / is not a 404"; response_content_is([$method, $path], $expected, $test_name) Asserts that the response content is equal to the $expected string. response_content_is [GET => '/'], "Hello, World", "got expected response content for GET /"; response_content_isnt([$method, $path], $not_expected, $test_name) Asserts that the response content is not equal to the $not_expected string. response_content_isnt [GET => '/'], "Hello, World", "got expected response content for GET /"; response_content_is_deeply([$method, $path], $expected_struct, $test_name) Similar to response_content_is(), except that if response content and $expected_struct are references, it does a deep comparison walking each data structure to see if they are equivalent. If the two structures are different, it will display the place where they start differing. response_content_is_deeply [GET => '/complex_struct'], { foo => 42, bar => 24}, "got expected response structure for GET /complex_struct"; response_content_like([$method, $path], $regexp, $test_name) Asserts that the response content for the given request matches the regexp given. response_content_like [GET => '/'], qr/Hello, World/, "response content looks good for GET /"; response_content_unlike([$method, $path], $regexp, $test_name) Asserts that the response content for the given request does not match the regexp given. response_content_unlike [GET => '/'], qr/Page not found/, "response content looks good for GET /"; response_headers_are_deeply([$method, $path], $expected, $test_name) Asserts that the response headers data structure equals the one given. response_headers_are_deeply [GET => '/'], [ 'X-Powered-By' => 'Dancer 1.150' ]; response_headers_include([$method, $path], $expected, $test_name) Asserts that the response headers data structure includes some of the defined ones. response_headers_include [GET => '/'], [ 'Content-Type' => 'text/plain' ]; dancer_response($method, $path, { params => $params, body => $body, headers => $headers, files => [{filename => '/path/to/file', name => 'my_file'}] }) Returns a Dancer::Response object for the given request. Only $method and $path are required. $params is a hashref, $body is a string and $headers can be an arrayref or a HTTP::Headers object, $files is an arrayref of hashref, containing some files to upload. A good reason to use this function is for testing POST requests. Since POST requests may not be idempotent, it is necessary to capture the content and status in one shot. Calling the response_status_is and response_content_is functions in succession would make two requests, each of which could alter the state of the application and cause Schrodinger's cat to die. my $response = dancer_response POST => '/widgets'; is $response->{status}, 202, "response for POST /widgets is 202"; is $response->{content}, "Widget #1 has been scheduled for creation", "response content looks good for first POST /widgets"; $response = dancer_response POST => '/widgets'; is $response->{status}, 202, "response for POST /widgets is 202"; is $response->{content}, "Widget #2 has been scheduled for creation", "response content looks good for second POST /widgets"; It's possible to test file uploads: post '/upload' => sub { return upload('image')->content }; $response = dancer_response(POST => '/upload', {files => [{name => 'image', filename => '/path/to/image.jpg'}]}); In addition, you can supply the file contents as the "data" key: my $data = 'A test string that will pretend to be file contents.'; $response = dancer_reponse(POST => '/upload', { files => [{name => 'test', filename => "filename.ext", data => $data}] }); read_logs my $logs = read_logs; Returns an array ref of all log messages issued by the app since the last call to "read_logs". For example: warning "Danger! Warning!"; debug "I like pie."; is_deeply read_logs, [ { level => "warning", message => "Danger! Warning!" }, { level => "debug", message => "I like pie.", } ]; error "Put out the light."; is_deeply read_logs, [ { level => "error", message => "Put out the light." }, ]; See Dancer::Logger::Capture for more details. LICENSE
This module is free software and is distributed under the same terms as Perl itself. AUTHOR
This module has been written by Alexis Sukrieh <sukria@sukria.net> SEE ALSO
Test::More perl v5.14.2 2012-03-31 Dancer::Test(3pm)
All times are GMT -4. The time now is 12:51 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy