Hi,
I want to write bash script that will keep on looking for files in a directory and if any file exists, it processes them. I want it to be a background process, which keeps looking for files in a directory.
Is there any way to do that in bash script?
I can loop through all the files like... (4 Replies)
hello
i have a requirement where i have a direcotry in which i get files in the format
STOCKS.20080114.dat
STOCKS.20080115.dat
STOCKS.20080117.dat
STOCKS.20080118.dat
i need to loop through the directory and sort by create date descending order and i need to process the first file.
... (1 Reply)
Hi all,
Can somebody help me with this problem pls.
I need to extract one specific line from each files in a folder and put
the all lines extracted in a unique output file in the following format.
line extracted, respective name of file, date of file.
I´m, trying the part to extract... (3 Replies)
hi all
i have some files present in a directory
i want to loop through all the files in the directory
each time i loop
i should change the in_file parameter in the control file and load it into a table using sql loader
there is only one table where i have to load alll the files ... (3 Replies)
Hi,
I am new to unix and shell scripting,can anybody help me in sctipting a requirement.
my requirement is to get the latest directory the name of the directory will be like CSB.monthdate_time stamp
like CSB.Sep29_11:16 and CSB.Oct01_16:21.
i need to pick the latest directory.
in the... (15 Replies)
I was looking to get some help with copying files in one directory to another using a for-in loop. My script file is called copyfile and here is what I have:
for file in $(ls -a $1)
do
cp $file ~/dir-2
done
When I run copyfile dir-1 this is what I get
cp: omitting directory `.'... (1 Reply)
Hi,
I would like to write a loop to change the names of files in a directory. The files are called data1.txt through data1000.txt. I'd like to change their names to a1.txt through a1000.txt. How do I go about doing that? Thanks! (2 Replies)
I am trying to loop through files in a directory, and sort each file. No matter what changes I make to the code, I get the following errors:
'aunch.sh: line 4: syntax error near unexpected token `do
'aunch.sh: line 4: `for f in ${FILES}/*; do
#!/bin/bash
FILES=$(pwd)
for f in ${FILES}/*;... (1 Reply)
I am trying to loop through files in a directory, and sort each file. No matter what changes I make to the code, I get the following errors:
'aunch.sh: line 4: syntax error near unexpected token `do
'aunch.sh: line 4: `for f in ${FILES}/*; do
#!/bin/bash
FILES=$(pwd)
for f in ${FILES}/*;... (6 Replies)
I have one question.
On the directory I have many files start with
DB.DAILYxxxxxxx.YYYYMMDD.HHMMSS
and I have several files with other format, like
LET.20170310
daily.20170310
tba.20170310
How can I exclude from my loop DB.DAILY files?
I tried
ls *20170310* | while read... (4 Replies)
Discussion started by: digioleg54
4 Replies
LEARN ABOUT DEBIAN
byteprefix
BYTEPREFIX(5) File Formats Manual BYTEPREFIX(5)NAME
byteprefix - Configuration for display of sizes
DESCRIPTION
There are two standard ways to use units in computing: base 10 (1 k = 10^3 = 1 000) and base 2 (1 K = 2^10 = 1 024). Historically, most
computer programs have used units in base 2, where 1 KB = 1 024 bytes, 1 MB = 1 048 576 bytes, etc. However, users are more likely to
expect and understand sizes in base 10, as this is the norm outside of computing.
This configuration file is a method for configuring programs (that use libkibi) to display sizes in the user's preferred style. It can be
configured through a configuration file or environment variable (which takes precedence).
When not using the "historic" style, IEC-style prefixes (KiB, MiB, etc.) are used for base 2 units, to disambiguate them from base 10 units
(kB, MB, etc.).
OPTIONS
There are three possible styles (Default: base10):
base2 Display all sizes in Base 2 with IEC prefixes.
1 KiB = 1 024 bytes.
1 MiB = 1 024 KiB = 1 048 576 bytes.
1 GiB = 1 024 MiB = 1 048 576 KiB = 1 073 741 824 bytes.
base10 Display all sizes in Base 10, except for sizes of RAM, which use base 2 with IEC prefixes.
Everything except RAM:
1 kB = 1 000 bytes.
1 MB = 1 000 kB = 1 000 000 bytes.
1 GB = 1 000 MB = 1 000 000 kB = 1 000 000 000 bytes.
RAM:
1 KiB = 1 024 bytes.
1 MiB = 1 024 KiB = 1 048 576 bytes.
1 GiB = 1 024 MiB = 1 048 576 KiB = 1 073 741 824 bytes.
historic
Display all sizes in Base 2, without IEC prefixes.
1 KB = 1 024 bytes.
1 MB = 1 024 KB = 1 048 576 bytes.
1 GB = 1 024 MB = 1 048 576 KB = 1 073 741 824 bytes.
Not recommended. This style uses base units 2 with prefixes usually associated with base 10 units. While it uses KB rather than the
SI (base 10) kB, there is no such distinction beyond the kilobyte range, and the units are ambiguous.
ENVIRONMENT
BYTEPREFIX
This environment variable will override the configured or default style. It should just contain one of the style names, listed in
OPTIONS above.
XDG_CONFIG_HOME
The location of the user's configuration files. If not set, it will be assumed to be ~/.config.
FILES
The preferred style can be set in a system-wide configuration file and/or in user's own configuration file (which will take precedence).
If no configuration file exists, the default style is base10.
/etc/byteprefix or XDG_CONFIG_HOME/byteprefix
This file should contain a single line: format=style. Lines beginning with # are treated as comments.
EXAMPLE
A user wanting base 2 display can set the following in ~/.config/byteprefix:
format=base2
SEE ALSO units(7)libkibi January 2011 BYTEPREFIX(5)