I don't know bash, but i wonder: does this work like a glob or like parameter expansion? In case of the latter there should be an error message if one of the files is missing, yes?
bakunin
No on both counts. With default settings a glob expression that doesn't match any files will be left unexpanded and if ls doesn't find a file with that name, it will produce a diagnostic message.
In the Korn shell {x..y} is called a sequence expression. Depending on what comes before or after the sequence expression, each element of the expanded sequence could then be treated as a globing (filename pattern matching) expression. If the filenames you're trying to match have leading zeros in a numeric sequence, your can also specifiy a printf-like format to control display of the elements in the sequence. And if you don't want each element you can also specify an increment as in the following example:
produces:
If you try:
and some of the files don't exist, ls will write a list of files that do exist to standard output and write a diagnostic to standard error for each pattern that is not an existing file. The diagnostic messages can be discarded using:
Of course, if the expansions exceed ARG_MAX, you'll have the same problem you'd have with the expansion of a globing expression that matches too many files...
This User Gave Thanks to Don Cragun For This Post:
When I use this command I get an output of some numbers
cat ac.20070511 | cut -d" " -f19
Is there any way for me to display only the numbers that are greater than 1000 but not all the numbers in the ouput.
Can any one help me with this. :) (8 Replies)
Hi,
I am new to Unix and was trying different ways of how to display the list of file names modified between a given date range in sorting order.I will get the fromdate and Todate from the browser, I need to display the list of all the file names that are modified between the given date... (1 Reply)
Hi All,
I want a shell script which can display the file with in the date range.
For Example I have 15 files with the following format
abc_01-01-2009.txt to abc_15-01-2009.txt.
Now I want to have the files between 4th of jan to 12th files.
How can I acheive this.
Advance... (1 Reply)
Hi All,
I have a requirement to display all the dates within the provided (through user input) date range.
For eg: If I enter 28012009 (as From date in the format 'DDMMYYYY') and 02022009(as To date in the format 'DDMMYYYY'), the output should be all dates occuring between the from and to... (11 Replies)
I have a data in a file called SCHED which has 5 columns: sched no, date, time, place and remarks. The image is shown below.
http://dl.dropbox.com/u/54949888/Screenshot%20from%202013-01-02%2002%3A42%3A25.png
Now, I want to display only the schedules which fall under a certain date range which... (2 Replies)
I have a list of columns with values that I need to transform into a row containing the range of each column. For example:
"Column A"
1
2
3
4
10
12
14
15
16
17
18
"Column B"
1
4
5
6 (4 Replies)
Gents,
It is possible to generate a range of values according to column 1 and count the total of rows in the range.
example
input
15.3
15.5
15.8
15.9
16.0
16.1
16.8
17.0
17.5
18.0
output desired
15.0 - 15.9 = 4 (10 Replies)
My script reads all the log files in a directory, the user would enter a range and the script would only display the files within those range. Here's my code:
#!/bin/bash
LOG_FILES=("Sandbox/logs/*")
for file in ${LOG_FILES}; do echo $file; done
-------------
for i in $(seq $1 $2); do... (1 Reply)