Thanks heaps agama that has worked a treat. I can barley understand it but I'll work on it a bit more. Quick question, why does it need to be piped to the kshell?
Not sure if your question was literally why is must be piped to a shell or if you meant must it be kshell -- would bash work. So, here are both answers:
The awk is generating the move commands, but needs kshell to execute them. It could be piped to bash, I just prefer Kshell so that's the way I tested it.
I'll add some comments to the code and maybe that will help you understand it a bit better.
---------- Post updated at 21:57 ---------- Previous update was at 21:45 ----------
I'm using Kshell scripts cronjobs to logrolling my daily log files and I stamped the log file at the end of the day by date stamp i.e.: %d_%m_%y-LogFile.
but the 22_01_2001-LogFile as example contains 21st Jan data and I want to stamp the log file with previous day.
so I'm trying to subtract... (3 Replies)
Help...please.
I have a log that contains
Warning Authentication Failed: User GHDT88998HS doesn't exit: The User GHDT88998HS could not be found Mar 22, 2008 5:22:22AM com.hometel.ttm.auth.userlogin.
about maybe a thousand entries failed user acct message
How can I grab just the username... (2 Replies)
I have a file like this:
Tue Apr 15 10:41:47 MDT 2008 FINAL RESULT; 6
Tue Apr 15 10:41:47 MDT 2008 FINAL RESULT; 2
Tue Apr 15 10:41:47 MDT 2008 FINAL RESULT; 5
With this command seira=`cut -f 2 -d ';' tes.txt` i take all the results (6,2,5 etc) and i store them in variable seira
When i do... (9 Replies)
Hi all,
I need help manipulating the file below.
Here is what I needed to do.
First, I have to replace INSUPD to DELETE.
Then I need to change the content of the file around by flipping the contents in the file from the bottom to the top (start from "CMD")
How should I attack this?
Here... (2 Replies)
Hi. I haven't had to write bash scripts in a long time and have a simple task to do, but need some help:
Input:
chrY:22627291-22651542
chrY:23045932-23070172
chrY:23684890-23696359
chrY:25318610-25330083
chrY:25451096-25462570
chr10:1054847-1061799
chr10:1058606-1080131... (7 Replies)
I need the command top to output as:
Memory: 2048M real, 1499M free, 53M swap in use, 5423M swap free
on just the memory line.
Instead, I have compiled the new version of top that displays as so:
Memory: 2048M phys mem, 1499M free mem, 5476 total swap, 5423M swap free
I read... (2 Replies)
Hi everybody,
I need an urgent help with a BASH script. I have file which contains (besides the other data) the lines with the following structure identified by with keyword PCList:
<PARAMETER NAME="PCList"
TYPE="LIST_STRUCTURE"
MODEL="{,}"
... (1 Reply)
Hi,
I need a shell/command to achieve this task.
I've a delimited unloaded file from oracle in a scrambled format as shown below with many blank lines in it, I'm just trying to tailor it in a format that would be compatible to view and load it to a IDS db.
Here is the problem
... (1 Reply)
Hi Guys,
I'm really new to Unix and Linux and other scripting languages but recently I hv been really enthusiatic about learning more to help out on my work.
So I have a file with 3 columns. A sample of it looks like looks like this :
K2_537841 AAATCAGCCGCAACATTTGC ... (7 Replies)
Not sure if the question posted in another forums can be moved by me.So posting the link here.
https://www.unix.com/unix-advanced-expert-users/221425-shell-script-manipulate-files.html#post302795379
Need your help here. (1 Reply)
Discussion started by: vedanta
1 Replies
LEARN ABOUT OPENSOLARIS
split
split(1) User Commands split(1)NAME
split - split a file into pieces
SYNOPSIS
split [-linecount | -l linecount] [-a suffixlength]
[file [name]]
split [-b n | nk | nm] [-a suffixlength] [file [name]]
DESCRIPTION
The split utility reads file and writes it in linecount-line pieces into a set of output-files. The name of the first output-file is name
with aa appended, and so on lexicographically, up to zz (a maximum of 676 files). The maximum length of name is 2 characters less than the
maximum filename length allowed by the filesystem. See statvfs(2). If no output name is given, x is used as the default (output-files will
be called xaa, xab, and so forth).
OPTIONS
The following options are supported:
-linecount | -l linecount
Number of lines in each piece. Defaults to 1000 lines.
-a suffixlength
Uses suffixlength letters to form the suffix portion of the filenames of the split file. If -a is not specified, the default suffix
length is 2. If the sum of the name operand and the suffixlength option-argument would create a filename exceeding NAME_MAX bytes, an
error will result; split will exit with a diagnostic message and no files will be created.
-b n
Splits a file into pieces n bytes in size.
-b nk
Splits a file into pieces n*1024 bytes in size.
-b nm
Splits a file into pieces n*1048576 bytes in size.
OPERANDS
The following operands are supported:
file The path name of the ordinary file to be split. If no input file is given or file is -, the standard input will be used.
name The prefix to be used for each of the files resulting from the split operation. If no name argument is given, x will be used as the
prefix of the output files. The combined length of the basename of prefix and suffixlength cannot exceed NAME_MAX bytes. See
OPTIONS.
USAGE
See largefile(5) for the description of the behavior of split when encountering files greater than or equal to 2 Gbyte ( 2^31 bytes).
ENVIRONMENT VARIABLES
See environ(5) for descriptions of the following environment variables that affect the execution of split: LANG, LC_ALL, LC_CTYPE, LC_MES-
SAGES, and NLSPATH.
EXIT STATUS
The following exit values are returned:
0 Successful completion.
>0 An error occurred.
ATTRIBUTES
See attributes(5) for descriptions of the following attributes:
+-----------------------------+-----------------------------+
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
+-----------------------------+-----------------------------+
|Availability |SUNWesu |
+-----------------------------+-----------------------------+
|CSI |Enabled |
+-----------------------------+-----------------------------+
|Interface Stability |Committed |
+-----------------------------+-----------------------------+
|Standard |See standards(5). |
+-----------------------------+-----------------------------+
SEE ALSO csplit(1), statvfs(2), attributes(5), environ(5), largefile(5), standards(5)SunOS 5.11 16 Apr 1999 split(1)