10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hii,
Could someone help me to append string to the starting of all the filenames inside a directory but it should exclude .zip files and subdirectories.
Eg.
file1: test1.log
file2: test2.log
file3 test.zip
After running the script
file1: string_test1.log
file2: string_test2.log
file3:... (4 Replies)
Discussion started by: Ravi Kishore
4 Replies
2. Shell Programming and Scripting
Hi frnds,
My requirement is I have a zip file with name say eg: test_ABC_UH_ccde2a_awdeaea_20150422.zip
within that there are subdirectories on each directory we again have .zip files and in that we have files like mama20150422.gz and so on.
Iam in need of a bash script so that it unzips... (0 Replies)
Discussion started by: Ravi Kishore
0 Replies
3. Shell Programming and Scripting
I need to run the same awk function over an entire directly of files.
This is the awk:
awk '{$(NF+1)=1}1'
Is there a way that I can run this command once over all of the files, along the lines of:
awk '{$(NF+1)=1}1' *
so that I do not have to run this several times?
My main concern is... (2 Replies)
Discussion started by: owwow14
2 Replies
4. Shell Programming and Scripting
#!/bin/bash
#
name=$1
type=$2
number=1
for file in ./**
do
if
then
filenumber=00$number
elif
then
filenumber=0$number
fi
tempname="$name""$filenumber"."$type"
if (4 Replies)
Discussion started by: TheGreatGizmo
4 Replies
5. Shell Programming and Scripting
Dear all,
I'm very new in scripting and using shell and prompt command.
I have a program (called fasta) and I need to iterate it over all files in a folder, but I'm not able to do that. Pratically the fasta program wants a sintax like this:
fasta.exe query_file.txt library_file.txt >... (2 Replies)
Discussion started by: gabrysfe
2 Replies
6. Shell Programming and Scripting
Korn Shell
I have hundreds of small files like below created every day. A midnight cron job moves them to the location /u04/temp/logs
But sometimes I have to manually move these files based a certain dates or time.
I have two basic requirements
1.Using mv command I want to move all .dat... (2 Replies)
Discussion started by: kraljic
2 Replies
7. UNIX for Dummies Questions & Answers
I write this bit of code to calculate the mean and variance for all the files in one directory and print the mean and variance in a separate folder but with the same file name.
FILES="data/*"
for X in $FILES
do
name=$(basename $X)
awk '{x=$0; s+=$0; n++}
END{mean=s/n; for (i in x){ss... (20 Replies)
Discussion started by: A-V
20 Replies
8. Shell Programming and Scripting
Hello, I'm a computer science major and I'm having problems dealing with file names with spaces in them. Particularly I'm saving a file name in a variable and then using the variable in a compare function i.e.
a='te xt.txt'
b='file2.txt'
cmp $a $b
If anyone could help me with this particular... (10 Replies)
Discussion started by: jakethegreycat
10 Replies
9. Shell Programming and Scripting
Hi ,
My requirement is that i need to search for a number of strings in a log file and print them with line numbers.The search should be date wise.
The sample log file is :
Jan 17 02:45:34 srim6165 MQSIv500: (UKBRKR1P_B.LZ_
BENCHMARKS)BIP2648E: Message backed out to a queue; node... (6 Replies)
Discussion started by: charudpss
6 Replies
10. Shell Programming and Scripting
I have a process run weekly where I must convert data formats for about thirty files. I read a text file that provides all of the filenames and switch settings.
My perl code is:
for ($j = 1; $j <= $k; $j++)
{
open(FIN2,$fin2) || die "open: $!";
do other stuff
}
Every once in... (2 Replies)
Discussion started by: joeyg
2 Replies