Sponsored Content
Full Discussion: Archive won't move
Top Forums UNIX for Dummies Questions & Answers Archive won't move Post 302678361 by neutronscott on Friday 27th of July 2012 04:44:29 PM
Old 07-27-2012
Quote:
Originally Posted by jrymer
Thanks neutronscott it worked, can you explain in a little more detail what your code does though? I am unfamiliar with printf, this section was hardest to read.
It's in the find manual. Rather than just printing file names, we include the modify time in epoch and also YYYY-MM format, then finally the filename NUL terminated. So even a filename with a new-line won't mess it up.

Quote:
Originally Posted by jrymer
the...
Code:
sort -znk1

is sorting in modified date order? Is the...
Code:
read -rd

taking the input from the printf?
-z is to print it back NUL terminated (GNU extention). -nk1 is for numerical sort on first position... bash's read you can set the delimiter to be different than newline. here we set it to '' (empty string, NUL). Yes, it reads off what is piped in from find's -printf for further processing in the shell's while loop.

Quote:
Originally Posted by jrymer
This helped a lot but I still do not understand why one tar was going into the created directory and the other was not with my script. I tried Alister's script and understand his change, but it yielded me the same result. Both tar files were still not going into the destination directory, only one was even though they should both have been in the same directory.
If alister's suggestion did not fix your script, i'd try bash -x ./script to see exactly what it is doing to follow the logic. It was my first thought.
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

why won't this Work?

hey programmers! 1-why won't gcc accept as an argument? i tried the recommendations on the man page of getch(),..etc. nothing worked. 2-why it won't see <iostream> && <fstream> even if i implemented the function as follow std::cout<<"..etc"<<endl; 3-after i type this code in it gives... (6 Replies)
Discussion started by: mbabeli
6 Replies

2. UNIX for Dummies Questions & Answers

HP 10.20 Won start

After I log ino the machine, a window pops up indicating that I should check that the HOSTNAME is the same in these three files /etc//rc.configd/netconf /etc/hosts /var/adm/inetd.sec How do I change the hostname in these files? Thanks, Mike h (1 Reply)
Discussion started by: hutchin
1 Replies

3. AIX

won't mount /usr...won't boot fully

Hello: NOOB here. I attempted to use smit mkcd. Failed on first attempt, not enough space. 2nd attempt tried to place iso on /usr, not enough space there. Cleanup ran for about 5 minutes after aborting. Now AIX won't boot. LCD display on 7029-6E3 says: 0517 MOUNT /USR. Attempted to boot from CD... (11 Replies)
Discussion started by: bbird
11 Replies

4. UNIX for Dummies Questions & Answers

sample script to archive & move previous day syslog files

hi all. Please help me with archiving previous day syslog files. the files have no extension and have the format YYYY-MM-DD. I want to archive the file then move it to some other machine. thanks. (2 Replies)
Discussion started by: coolatt
2 Replies

5. Shell Programming and Scripting

Extracting from archive | compressing to new archive

Hi there, I have one huge archive (it's a system image). I need sometime to create smaller archives with only one or two file from my big archive. So I'm looking for a command that extracts files from an archive and pipe them to another one. I tried the following : tar -xzOf oldarchive.tgz... (5 Replies)
Discussion started by: chebarbudo
5 Replies

6. AIX

xntpd won't stay up...

AIX 5.3-5300.09.06.1013 (AIX 5.3 TL9 SP6) # startsrc -s xntpd -a "-x" (with -x at the end of the xntpd line in /etc/rc.tcpip, too.) will run for 5-15 minutes, and then die. # errpt -a with a search on xntpd gives me this: ------------------------------------------------ LABEL: ... (7 Replies)
Discussion started by: dafydd2277
7 Replies

7. Shell Programming and Scripting

Archive & move the file

I have a set of files in path /ifx01/etldata/lmt/ a.xml b.xml I have to archive & move these files to path /ifx01/etldata/archive ,so that not even the original files should exists. After acrhiving there should be no files in path /ifx01/etldata/lmt/ (6 Replies)
Discussion started by: jagadeeshn04
6 Replies

8. Shell Programming and Scripting

Move all files from dir and subdir to Archive with File name as complete path_filename

HI, I need to move all files from a dir & its all subdir to Archive folder which is indise dir only. and moved filename should changed to complete path ( Like Dir_subdir_subdir2_.._filename ). also all files names shoud capture in a file in order to mail I written below code ... (11 Replies)
Discussion started by: minijain7
11 Replies

9. Shell Programming and Scripting

Script to archive logs and sftp to another archive server

Requirement: Under fuse application we have placeholders called containers; Every container has their logs under: <container1>/data/log/fuse.log <container1>/data/log/fuse.log.1 <container1>/data/log/fuse.log.XX <container2>/data/log/fuse.log... (6 Replies)
Discussion started by: Arjun Goswami
6 Replies

10. UNIX for Beginners Questions & Answers

Bash script won't run because hardware won't produce display

Can anyone offer any advice on how to modify the script below to work on a new system we have, that has no graphics capability? We admin the system through a serial RAS device. I've tried running the below script through the RAS and through an ssh -X session. It failed with something like "GTK... (3 Replies)
Discussion started by: yelirt5
3 Replies
FBB::mlm(3bobcat)                                             OFoldStream manipulator                                            FBB::mlm(3bobcat)

NAME
FBB::mlm - Manipulator modifying left margins of OFoldStream objects SYNOPSIS
#include <bobcat/ofoldstream> or #include <bobcat/ofoldstreambuf> Linking option: -lbobcat DESCRIPTION
The mlm class implements a manipulator that can be inserted into OFoldStream objects to modify the stream's left margin by a requested amount. The request cannot result in a negative left margin value. If a negative left margin would be the arithmetic result of the request then left margin 0 will silently be used. Depending on the tab-setting of the OFoldStream the inserted value represents the number of blank space characters or the number of tab-characters that will be added to the left margin. The request will be processed at the next newline character or std::flush or std::endl manipulator that is inserted into the stream. If a line is still empty once an mlm object and a flush manipulator are inserted into the stream then the new left margin will be effective at the next word inserted into that line (cf., the example section below) A bad_cast exception is thrown when the manipulator is inserted into an ostream that is not using a OFoldStreambuf buffer. NAMESPACE
FBB All constructors, members, operators and manipulators, mentioned in this man-page, are defined in the namespace FBB. INHERITS FROM
- CONSTRUCTOR
o mlm(int addValue): The standard copy constructor is available. MEMBER FUNCTIONS
There are no public or protected member functions in this class. EXAMPLE
#include <iostream> #include <bobcat/ofoldstream> using namespace std; using namespace FBB; int main() { OFoldStream out(cout, 0, 80); out << "hello world (left margin is 0)" << mlm(4) << " " "this uses a 4 character wide left margin " << mlm(-10) << flush << "left margin -6 changed to 0, active on this line "; return 0; } FILES
bobcat/mlm - defines the class interface SEE ALSO
bobcat(7), manipulators(3bobcat), lm(3bobcat), ofoldstream(3bobcat) BUGS
None Reported. DISTRIBUTION FILES
o bobcat_3.01.00-x.dsc: detached signature; o bobcat_3.01.00-x.tar.gz: source archive; o bobcat_3.01.00-x_i386.changes: change log; o libbobcat1_3.01.00-x_*.deb: debian package holding the libraries; o libbobcat1-dev_3.01.00-x_*.deb: debian package holding the libraries, headers and manual pages; o http://sourceforge.net/projects/bobcat: public archive location; BOBCAT
Bobcat is an acronym of `Brokken's Own Base Classes And Templates'. COPYRIGHT
This is free software, distributed under the terms of the GNU General Public License (GPL). AUTHOR
Frank B. Brokken (f.b.brokken@rug.nl). libbobcat1-dev_3.01.00-x.tar.gz 2005-2012 FBB::mlm(3bobcat)
All times are GMT -4. The time now is 06:22 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy