Sponsored Content
Full Discussion: Looping over output of 'ls'
Top Forums Shell Programming and Scripting Looping over output of 'ls' Post 302936447 by Scrutinizer on Wednesday 25th of February 2015 02:01:51 PM
Old 02-25-2015
Quote:
Originally Posted by ikable
It's also not necessary to quote your $i element.
$i should be wrapped in double quotes to avoid field splitting or other interpretations by the shell. If there are files with spaces for example, they will break your script..

Last edited by Scrutinizer; 02-25-2015 at 03:08 PM..
This User Gave Thanks to Scrutinizer For This Post:
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Help with looping

Hi, Actually I have a file which consists data . for eg names. Then I want my sql query to read this file and produce the output. Currently I am using this FOR EG : FILENAME is NAMES for i in `cat NAMES` { sqlplus -s $CONNECTID << EOF spool rooh set heading off select... (1 Reply)
Discussion started by: rooh
1 Replies

2. Shell Programming and Scripting

looping

Hi I have around 100 users in sun server and have default home directory in /usr/home/<username> I want to clean their home directory time to time to make free space on root, as users generate many output files during usage of application. My idea is, generate a file with following command... (4 Replies)
Discussion started by: ishir
4 Replies

3. Shell Programming and Scripting

for looping

I run into a issue when I try to do sorting of the following with ascending order, one round of for looping seems not working, anyone knows how to use shell or perl? $array = (5,0,3,2,7,9,8) (2 Replies)
Discussion started by: ccp
2 Replies

4. Shell Programming and Scripting

Looping

Hi, Now I have written a script which sorts the records in the file and splits them according to some condition. Now, I need to modify the script so that it reads all the files one after the other and does the sorting & splitting. Pls help me in reading all the files in a directory and... (8 Replies)
Discussion started by: Sunitha_edi82
8 Replies

5. Shell Programming and Scripting

perl: looping through the output of a 'system' command

Hi there could anybody point me in the right direction when it comes to looping through the output of a system command in perl (i.e. df -k) doing a test against each line to see if it matches? for example if i have a df -k output like this and I wanted to grab the lines that matched "sda" or... (3 Replies)
Discussion started by: rethink
3 Replies

6. Solaris

SVM Solaris 8 Problem. Metastat output looping

Hi friends, I'm newbie to SVM. Just wanna try installed it on one of our server (to do mirroring for disk0 and disk1) but i think im lost until now. :( the steps i've taken is as below:- 1.prtvtoc /dev/rdsk/c1t0d0s2 | fmthard -s - /dev/rdsk/c1t1d0s2 2.metadb -a -c 3 -f c1t0d0s7... (3 Replies)
Discussion started by: kronenose
3 Replies

7. Shell Programming and Scripting

looping and saving output of each line separately

I have been trying this program for a long time. I am trying to read a file named "odon" line by line; read the first line, send it to do a command saved in a file "perm", once the first line has finished going through the content of the file perm, the result is saved with the number of the line.... (17 Replies)
Discussion started by: iconig
17 Replies

8. UNIX for Dummies Questions & Answers

Looping through the contents of array for output name

Hi all, I am trying to loop through the string contents of an array, to add it during the saving of the output files. I am trying this code to print each column and save it to unique file name, but it doesn't work. Thanks for any help. fnam=(japan usa uk) alldata.dat contained sample data... (1 Reply)
Discussion started by: ida1215
1 Replies

9. Shell Programming and Scripting

Looping

Hey guys, so I am trying to do a loop script that will go through each folder (no gui so just each domain has a folder) and grab out the databases being used on that domain. I know I would use mysql -e "show databases where not 'information_schema';" once in each directory to pull the actual... (3 Replies)
Discussion started by: dough
3 Replies

10. UNIX for Beginners Questions & Answers

Looping through input/output

Hi, I've got a directory of about 6000 txt files that look like this: a b c d e f g h k l m n I need to execute a command on them to combine them and, in the end, have one big file with all the needed columns taken form all the 6000 files. I've got the "combining" program, but my problem... (26 Replies)
Discussion started by: zajtat
26 Replies
xls2csv(1)						      General Commands Manual							xls2csv(1)

NAME
xls2csv - reads MS-Excel file and puts its content as comma-separated data on standard output SYNOPSIS
xls2csv [-xlV] [-f format ] [-b string ] [-s charset ] [-d charset ] [-q number ] [-c char] files DESCRIPTION
xls2csv reads MS-Excel spreadsheet and dumps its content as comma-separated values to stdout. Numbers are printed without delimiters, strings are enclosed in the double quotes. Double-quotes inside string are doubled. OPTIONS
-x print unknown Unicode chars as xNNNN, rather than as question marks -l list known charsets and exit successfully -cchar cell separator char. By default - comma. -bstring sheet break string. This string (by default - formfeed) would be output at the end of each workbook page. This string is printed after page starting at start of line, but no linefeed would be automatically added at the end of string. Include newline at the ent of sheet separator if you want it to appear on separate line by itself -gnumber number of decimal digits in the numbers. By default maximal double precision (system-dependent macro DBL_DIG) is used. -qnumber set quote mode. In quote mode 0 cell contents is never quoted. In quote mode 1 only strings which contain spaces, double quotes or commas are quoted. In quote mode 2 (default) all cells with type string are quoted. In quote mode 3 all cells are quoted. -dcharset` - specifies destination charset name. Charset file has format described in CHARACTER SETS section of catdoc(1) manual page. By default, current locale charset would be used if langinfo support was enabled at the compile time. -scharset - specifies source charset. Typically, Excel files have CODE PAGE record, which denotes input charset, but for some reason you may wish to override it. -fformat - specifies date/time format to use for output of all Excel date and time values. If this option is not specified, format, speci- fied in the spreadsheet is used. On POSIX system any format, allowed by strftime(3) can be used as value of this option. Under MS- DOS xls2csv implements limited set of strftime formats, namely m, d, y, Y, b, l, p, H, M, S. -V outputs version number FILES
${HOME}/.catdocrc, catdoc charset files and substitution map files (see catdoc(1) manual page for details, SEE ALSO
cat(1), catdoc(1), strings(1), utf8(7), unicode(7) AUTHOR
V.B.Wagner <vitus@45.free.net>, based on biffview by David Rysdam MS-Word reader Version 0.94.4 xls2csv(1)
All times are GMT -4. The time now is 02:46 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy