I need to count files existing in my current directory with the file extention of *.log.* so that I can initialise using the loop like
x=0
while [ $x -lt $num ]
do
> $(eval echo \$$i).log.$x
x=`expr $x + 1`
done
How can I do it please give me a quick tips.
I am trying to a different number of parameter to a script and check them but I don't know where did I go wrong?.
I wrote the following script
test.sh
#!/bin/sh
count=$#
i=1
while [ $i -le $count ]; do
echo "parameter " $i " is " ${i}
i=`expr $i + 1`
done...
I have got a directory structure a/b/error, a/b/report and error directory has error.log1, error.log2...... filese and report directory has report.log1 report.log2..... and my aim is to crearte a file totalerror.log and totalreport.log in their respective directories and then move both...
Thanks gamerland for your help.
It does similar work but I need to select the number of files with the generation numbers such as test1, test2 and so on from a directory where lots of othere files exists and then concatinate them to a combined file called datetime and compress the datetime...
I am very new to unix, I need to navigate to different directories and concatenate the files to one file, then compress the file and archive to another directory.
I was thinking of using cat, gzip and mv commands. Please can some one give me bit of help.
Thanks in advance
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.