Sponsored Content
Top Forums Shell Programming and Scripting List files with number to select based on number Post 302979200 by mysocks on Wednesday 10th of August 2016 08:26:43 PM
Old 08-10-2016
Quote:
Originally Posted by rdrtx1
add to top of script:

Code:
#!/bin/ksh

This worked for me. Thanks! Smilie
 

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Split single file into multiple files based on the number in the column

Dear All, I would like to split a file of the following format into multiple files based on the number in the 6th column (numbers 1, 2, 3...): ATOM 1 N GLY A 1 -3.198 27.537 -5.958 1.00 0.00 N ATOM 2 CA GLY A 1 -2.199 28.399 -6.617 1.00 0.00 ... (3 Replies)
Discussion started by: tomasl
3 Replies

2. Shell Programming and Scripting

Script to split files based on number of lines

I am getting a few gzip files into a folder by doing ftp to another server. Once I get them I move them to another location .But before that I need to make sure each gzip is not more than 5000 lines and split it up . The files I get are anywhere from 500 lines to 10000 lines in them and is in gzip... (4 Replies)
Discussion started by: gubbu
4 Replies

3. Shell Programming and Scripting

Creating folders based on number of files

I have hundreds of files numbered in consecutive number in one single folder What I would like to do is to make as many subfolders as needed (dependeing on the number of individual files) and name them Folder01, Folder02, etc. Then, move file01 to folder01, file02 to folder02 so on and so... (3 Replies)
Discussion started by: Xterra
3 Replies

4. UNIX for Dummies Questions & Answers

How to list number of files through Crontab?

Hello All, I am trying to put this line in Crontab (Linux box- x86_64), but the command is not running. Can you please help me out? My requirement is- To find out the number of .csv files older than 1 day in directory /stage/landing. There are 2 other subdirectories under this directory... (6 Replies)
Discussion started by: NARESH1302
6 Replies

5. Shell Programming and Scripting

Make new files based on the number extracted

Hi All, I have a big file which looks like this: 0 4.5 6.7 0 3.4 6 1 5 6 1 6 4 2 9 4.44 Above is just a miniature version of the file. In fact, considering the first column of the file that is 0 0 1 1 2, the numbers in actual go until 10442. This means my actual file looks like... (2 Replies)
Discussion started by: shoaibjameel123
2 Replies

6. UNIX for Dummies Questions & Answers

Command to split the files based on the number of lines in it

Hello Friends, Can anyone help me for the below requirement. I am having a file called Input.txt. My requirement is first check the count that is wc -l input.txt If the result of the wc -l Input.txt is less than 10 then don't split the Input.txt file. Where as if Input.txt >= 10 the split... (12 Replies)
Discussion started by: malaya kumar
12 Replies

7. Shell Programming and Scripting

How to count number of files in directory and write to new file with number of files and their name?

Hi! I just want to count number of files in a directory, and write to new text file, with number of files and their name output should look like this,, assume that below one is a new file created by script Number of files in directory = 25 1. a.txt 2. abc.txt 3. asd.dat... (20 Replies)
Discussion started by: Akshay Hegde
20 Replies

8. UNIX for Dummies Questions & Answers

Sort Files based on the number(s) on the file name

Experts I have a list of files in the directory mysample1 mysample2 mysample3 mysample4 mysample5 mysample6 mysample7 mysample8 mysample9 mysample10 mysample11 mysample12 mysample13 mysample14 mysample15 (4 Replies)
Discussion started by: dsedi
4 Replies

9. UNIX for Beginners Questions & Answers

Select and copy .csv files based on row and column number

Dear UNIX experts, I'm a command line novice working on a Macintosh computer (Bash shell) and have neither found advice that is pertinent to my problem on the internet nor in this forum. I have hundreds of .csv files in a directory. Now I would like to copy the subset of files that contains... (8 Replies)
Discussion started by: rcsapo
8 Replies
LKSH(1) 						    BSD General Commands Manual 						   LKSH(1)

NAME
lksh -- Legacy Korn shell built on mksh SYNOPSIS
lksh [-+abCefhiklmnprUuvXx] [-+o opt] [-c string | -s | file [args ...]] DESCRIPTION
lksh is a command interpreter intended exclusive for running legacy shell scripts. It is built on mksh; refer to its manual page for details on the scripting language. LEGACY MODE
lksh has the following differences from mksh: o lksh is not suitable for use as /bin/sh. o There is no explicit support for interactive use, nor any command line editing code. Hence, lksh is not suitable as a user's login shell, either; use mksh instead. o The KSH_VERSION string identifies lksh as ``LEGACY KSH'' instead of ``MIRBSD KSH''. o Some mksh specific extensions are missing; specifically, the -T command-line option. o lksh always uses traditional mode for constructs like: $ set -- $(getopt ab:c "$@") $ echo $? POSIX mandates this to show 0, but traditional mode passes through the errorlevel from the getopt(1) command. o lksh, unlike AT&T UNIX ksh, does not keep file descriptors > 2 private. o lksh parses leading-zero numbers as octal (base 8). o Integers use the host C environment's long type, not int32_t. Unsigned arithmetic is done using unsigned long, not uint32_t. Neither value limits nor wraparound is guaranteed. Dividing the largest negative number by -1 is Undefined Behaviour (but might work on 32-bit and 64-bit long types). o lksh only offers the traditional ten file descriptors to scripts. SEE ALSO
mksh(1) https://www.mirbsd.org/mksh.htm https://www.mirbsd.org/ksh-chan.htm CAVEATS
lksh tries to make a cross between a legacy bourne/posix compatibl-ish shell and a legacy pdksh-alike but ``legacy'' is not exactly speci- fied. Parsing numbers with leading zero digits or ``0x'' is relatively recent in all pdksh derivates, but supported here for completeness. It might make sense to make this a run-time option, but that might also be overkill. The set built-in command does not have all options one would expect from a full-blown mksh or pdksh. Talk to the MirOS development team using the mailing list at <miros-mksh@mirbsd.org> or the #!/bin/mksh (or #ksh) IRC channel at irc.freenode.net (Port 6697 SSL, 6667 unencrypted) if you need any further quirks or assistance, and consider migrating your legacy scripts to work with mksh instead of requiring lksh. MirBSD February 11, 2013 MirBSD
All times are GMT -4. The time now is 07:52 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy