04-22-2014
Wow thanks so much, both awk options and the csplit command worked. I really appreciate the help.
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hello I am facing a scenario where I have a file with XML content and I am running shell script over it. But the problem is the XML is getting updated with new services. In the below scenario, my script takes values from the xml file from one service name say ABCD. Since there are multiple, it is... (8 Replies)
Discussion started by: chiru_h
8 Replies
2. Shell Programming and Scripting
Hi,
I have a script that works on a unix box but am trying to get it working on a linux box that uses shell. I am not a programmer so this is proving harder than I imagined. I made some changes and ended up with the script below but when I run it I get the following messages. Any help would be... (4 Replies)
Discussion started by: yabai
4 Replies
3. Shell Programming and Scripting
hi, first congratulations on the nice forum!
Can anybody write script, which can make copy of some or all files of the current directory in new directory (called "backups", which must be made in the current directory, if it's not already exist). And bring out a massage (report) with the count... (7 Replies)
Discussion started by: Cecko
7 Replies
4. Shell Programming and Scripting
I have a directory full of zip files.
How would I write a bash script to enumerate all the zip files, remove the ".zip" from the file name, create a directory by that name and unzip each zip file into its corresponding directory?
Thanks!
Siegfried (3 Replies)
Discussion started by: siegfried
3 Replies
5. Shell Programming and Scripting
Hi-
I am hoping someone can give me some pointers to get me started. I have a file which contains some dn's .e.g file 1
cn=bob,cn=user,dc=com
cn=kev,cn=user,dc=com
cn=john,cn=user,dc=com
I have a second file e.g. file.template which looks something like :-
dn: <dn>
objectclass:... (5 Replies)
Discussion started by: sniper57
5 Replies
6. Homework & Coursework Questions
I am very new to Linux/Unix. Kindly assist the following:
I wish to write a bash shell script called how_many_to_go that calculates and prints the number of days, hours, minutes and/or seconds until the end of the current month (based on the output of the date command).
Do ... (2 Replies)
Discussion started by: alobi
2 Replies
7. Shell Programming and Scripting
i'm trying to write a bash script that that will automatically extract zip files after the download.
i writed this script
#!/bin/bash
wget -c https://github.com/RonGokhle/kernel-downloader/zipball/master
CURRENDIR=/home/kernel-downloader
cd $CURRENDIR
rm $CURRENDIR/zipfiles 2>/dev/null
... (2 Replies)
Discussion started by: ron gokhle
2 Replies
8. UNIX for Dummies Questions & Answers
Hi All,
Just have a requirement, I am executing a bash shell script, my requirement is to catch the pid and job name to a txt file in the same directory, is there anyway to do it? please help me out.
Regards
Rahul
---------- Post updated at 08:42 AM ---------- Previous update was at... (2 Replies)
Discussion started by: rahulkalra9
2 Replies
9. Shell Programming and Scripting
Help! :)
I am getting an output file that looks similar to below.
EMAIL_ADDR
-----------------------------------------------------------------------------------
user@gmail.com
DATABASENAME
-----------------------------------------------------------------------------------
db1
db2
db3... (6 Replies)
Discussion started by: cpolikowsky
6 Replies
10. UNIX for Beginners Questions & Answers
Hello guys, I need some help. I am new in bash and I don't know how to automate the following script.
head -2 out1 > 1.fasta
sed ‘1,2 d' out1 > out2
rm out1
head -2 out2 > 2.fasta
sed ‘1,2 d' out2 > out1
rm out2
head -2 out2 > 3.fasta
sed '1,2 d' out2 > out1
rm out2
.......... (3 Replies)
Discussion started by: dellia222
3 Replies
LEARN ABOUT OPENDARWIN
csplit
CSPLIT(1) User Commands CSPLIT(1)
NAME
csplit - split a file into sections determined by context lines
SYNOPSIS
csplit [OPTION]... FILE PATTERN...
DESCRIPTION
Output pieces of FILE separated by PATTERN(s) to files 'xx00', 'xx01', ..., and output byte counts of each piece to standard output.
Read standard input if FILE is -
Mandatory arguments to long options are mandatory for short options too.
-b, --suffix-format=FORMAT
use sprintf FORMAT instead of %02d
-f, --prefix=PREFIX
use PREFIX instead of 'xx'
-k, --keep-files
do not remove output files on errors
--suppress-matched
suppress the lines matching PATTERN
-n, --digits=DIGITS
use specified number of digits instead of 2
-s, --quiet, --silent
do not print counts of output file sizes
-z, --elide-empty-files
remove empty output files
--help display this help and exit
--version
output version information and exit
Each PATTERN may be:
INTEGER
copy up to but not including specified line number
/REGEXP/[OFFSET]
copy up to but not including a matching line
%REGEXP%[OFFSET]
skip to, but not including a matching line
{INTEGER}
repeat the previous pattern specified number of times
{*} repeat the previous pattern as many times as possible
A line OFFSET is a required '+' or '-' followed by a positive integer.
AUTHOR
Written by Stuart Kemp and David MacKenzie.
REPORTING BUGS
GNU coreutils online help: <http://www.gnu.org/software/coreutils/>
Report csplit translation bugs to <http://translationproject.org/team/>
COPYRIGHT
Copyright (C) 2017 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law.
SEE ALSO
Full documentation at: <http://www.gnu.org/software/coreutils/csplit>
or available locally via: info '(coreutils) csplit invocation'
GNU coreutils 8.28 January 2018 CSPLIT(1)