identify files with "Normal termination" and compress them into a .tar.gz file
Hi,
I have hundreds of files "*.out" located in one folder,
and I want to:
1. Identify the good files containing "Normal termination" (grep "Normal termination" *.out )
2. Compress the good files into a tar.gz file (tar cvfz good.tar.gz *.goog.out )
Is there a way I can automate this process using a shell script?
Elaborating on ctsgnb you could compress the tar file in the same command:-
This should work if the z flag is not supported by your operating system.
If there are too many files for the grep to cope with (i.e. if *.out expands to build a command line of more than the maximum command length for your operating system) you could convert to find however this would decend any subdirectories and follow symbolic links. Another problem you may hit would be that the list of files generated could be longer that would fit one command for the tar part. Using xargs may cause you to backup over the same file several times. You would end up with a file of only the last groups written to the archive.
If you have AIX, you can capture the file names in another file then use that with the -L flag, but I'm not sure which other operating systems support this.
Hello.
System : opensuse leap 42.3
I have a bash script that build a text file.
I would like the last command doing :
print_cmd -o page-left=43 -o page-right=22 -o page-top=28 -o page-bottom=43 -o font=LatinModernMono12:regular:9 some_file.txt
where :
print_cmd ::= some printing... (1 Reply)
This is a script I got off the web for transferring Safari's "reading list" to the Pocket app. I ran it in terminal with the command bash exportsafarireadinglist.sh and got syntax error: unexpected end of file. Thanks for any help! The code:
#!/bin/bash
# Script to export Safari's reading... (2 Replies)
How to use "mailx" command to do e-mail reading the input file containing email address, where column 1 has name and column 2 containing “To” e-mail address
and column 3 contains “cc” e-mail address to include with same email.
Sample input file, email.txt
Below is an sample code where... (2 Replies)
Hi guys,
i'm running a program on samsumg 6410 arm cpu board. it caused an "free(): invalid next size (normal)" fail.
i try to use gdb for remote debugging:
1, start gdb server on board:
gdbserver 192.168.1.20:1234 ./HostAP
Process ./HostAP created; pid = 499
Listening on port... (8 Replies)
Hi,
I have line in input file as below:
3G_CENTRAL;INDONESIA_(M)_TELKOMSEL;SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL
My expected output for line in the file must be :
"1-Radon1-cMOC_deg"|"LDIndex"|"3G_CENTRAL|INDONESIA_(M)_TELKOMSEL"|LAST|"SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL"
Can someone... (7 Replies)
I have high values (such as ˙˙˙˙) in a text file contained in an Unix AIX server. I need to identify all the records
which are having these high values and also get the position/column number in the record structure if possible. Is there
any Unix command by which this can be done to :
1.... (5 Replies)
Hi,
I'm seeing the error vmunix: file: table is full in syslog.log.
Although changing the value of the kernel parameter nfile would make this error go away, how would I identify which process/application in the server is triggering this error? The server is a HP-UX B.11.11.
Thanks in advance! (1 Reply)
To speed up our backups, I found a way to compress all the backups files without running out of space. But before starting to use this in our procedures, I want to know if the command 'compress' has any issues in AIX 4.2 with files bigger then 1Gig. Our backup files have sizes ranging between 600Mg... (1 Reply)
Ok,
I use the command tar -cvf ~kw4691/output/test.tar ~kw4691/input on one UNIX server, lets call it sneezy. I FTP the tared file over to another server, lets call it bashful. Use the tar -xvf test.tar command and get the error
~kw4691/input "could not create the directory"
/hom/dev/sy40... (7 Replies)
At times we see the "file in use" when we run RCS (revision conrol system" on this file. Most of time, we do not see this message.
How do we identify the locks on this file and how do we release those locks? I can imagine it happens when there are some processes running on this file.
THe... (1 Reply)