10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
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)
Discussion started by: ldorsey
6 Replies
2. Shell Programming and Scripting
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)
Discussion started by: ldorsey
1 Replies
3. Shell Programming and Scripting
Hello ALL,
need a BASH script who find file and send email with attachment.
I have 50 folders without sub directories in each generated files of different sizes but with a similar name Rp01.txt Rp02.txt Rp03.txt ...etc. Each directors bound by mail group, I need a script that goes as... (1 Reply)
Discussion started by: penchev
1 Replies
4. Shell Programming and Scripting
Hello
How do I loop through files in a specific directory ?
This script is not working!
#! /bin/bash
FILES=/usr/desktop/input/*
For f in $FILES;
do
awk '-v A="$a" -v B="$b" {$6=($1-64)/2 ;$7=((10^($6/10))/A)^(1/B) ; print}' OFS="\t" $f > /root/Desktop/output/$f.txt;
done
... (7 Replies)
Discussion started by: ali.seifaddini
7 Replies
5. UNIX for Dummies Questions & Answers
Some guidance is highly appreciated.
I have 10 directories with names ending with 'xyz', each of them have about 30000 files. I want to loop through the contents of each directory and produce a single output per directory. So I want to have 10 output files named 'directory_name'_out.
With... (1 Reply)
Discussion started by: newbie83
1 Replies
6. UNIX for Dummies Questions & Answers
I am trying to loop through folders and extract the name of the lowest level subfolder
I was running the script below, it returns
/bb/bin/prd/newyork
/bb/bin/prd/london
/bb/bin/prd/tokyo
I really want
newyork
london
tokyo
I couldn't find a standard variable for the lowest level... (1 Reply)
Discussion started by: personalt
1 Replies
7. Shell Programming and Scripting
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)
Discussion started by: rajesh_tns
3 Replies
8. Shell Programming and Scripting
I have the following script:
#!/usr/bin/ksh
export MDIR=/datafiles
NAME=$1
SERVER=$2
DIRECTORY=$3
DATABASE=$4
ID=$5
export dirlist=`/usr/bin/ssh -q $ID@$SERVER find $DIRECTORY -type d -print`
for dir in $dirlist
do
SIZE=`</dev/null /usr/bin/ssh -q $ID@$SERVER du -ks $dir`
echo... (6 Replies)
Discussion started by: la_womn
6 Replies
9. AIX
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)
Discussion started by: dsdev_123
1 Replies
10. Shell Programming and Scripting
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)
Discussion started by: rladda
4 Replies