Search Results

Search: Posts Made By: smile689
1,987
Posted By greet_sed
If you have gnu find use -iname for case...
If you have gnu find use -iname for case insensitive match.

otherwise, try like this for example :
find . -name '[fF]2'

to match
f2
F2
7,350
Posted By CarloM
Specify the name as a parameter: find...
Specify the name as a parameter:
find $file_path1 -name *$file_nm* -type f -mtime +$days
7,350
Posted By Scott
Change the command to: find $file_path1...
Change the command to:

find $file_path1 -name "*$file_nm*" -type f -mtime +$days -exec rm -f {} \;

as it should be.
7,350
Posted By MadeInGermany
Quick and dirty, suppress ALL error messages: ...
Quick and dirty, suppress ALL error messages:

set +e # on error continue
find $file_path1/*$file_nm* -type f -mtime +$days -exec rm -f {} \; 2>/dev/null
find $file_path2/*$file_nm* -type f...
2,796
Posted By Aia
Since you did not post your last given command I...
Since you did not post your last given command I am going to guess and recommend that you tested first with:

find /etc/logs/*aa* -type f -atime +59 -exec ls -l {} \;

That should pick the files...
20,549
Posted By Don Cragun
Change: find $File_Path/*$file_nm* -type f...
Change:
find $File_Path/*$file_nm* -type f -atime +$days -exec mv {} $Dest_Path \;to:
find $File_Path/*$file_nm* -type f -atime +$days -exec mv -f {} $Dest_Path \;
4,264
Posted By Don Cragun
find /home/etc -type f -atime -10 -exec mv {}...
find /home/etc -type f -atime -10 -exec mv {} /other/directory \;
1,240
Posted By Don Cragun
The suggestion hergp made shows you how to use...
The suggestion hergp made shows you how to use the for loop. A simpler way to perform what this script does is:
#!/bin/ksh
Src_Dir="/home/etc"
file_nm ="ab.temp"
cd "$Src_Dir"
printf "%s\n"...
1,240
Posted By hergp
... for File in $Src_Dir/$File_nm* ...
...
for File in $Src_Dir/$File_nm*
...
4,547
Posted By Akshay Hegde
You may try this also... $ cat <<EOF | awk...
You may try this also...

$ cat <<EOF | awk '{gsub(/[A-Za-z._]/,x,$0);1}1'
AB_XYZA_20130930183017.log
AB_DY_XYZA_20130930183017.log
AB_GZU_20130930183017.log
EOF

20130930183017...
1,746
Posted By pravin27
If I understood correctly , you mean to say copy...
If I understood correctly , you mean to say copy files from /home/etc/AB*20130930* to /home/etc/ARC_20130930/

file_path="/home/etc"
Last_Day=20130930

if [ ! -d "$file_path/ARC_${Last_Day}" ]...
1,342
Posted By krishmaths
The dot in find . invokes the search from...
The dot in find . invokes the search from present working directory. The command is trying to find files under present directory and with name /home/etc/files/ABC*

If you had a file as below then...
1,342
Posted By Scott
The name argument should be a file name (or...
The name argument should be a file name (or glob), not a path. . (the path) should contain the path.


find /home/etc/files -name "ABC*" | wc -l
2,441
Posted By jim mcnamara
diff returns 0 when no differences are found, 1...
diff returns 0 when no differences are found, 1 when there are differences, >1 (2,3,4...)
when there was an error.

Probably the best usage is to cover all possibilities by looking for all the...
2,441
Posted By vidyadhar85
there is no not command in ksh. try ! or test
there is no not command in ksh. try ! or test
2,488
Posted By RavinderSingh13
Hello smile689, could you please try this,...
Hello smile689,

could you please try this, may be it will be helpful for you.



$ cat timings_file_query.ksh


echo "Please enter the number of files present types for files like...
2,488
Posted By Yoda
Using awk: ls YDT:FILE* | awk -F: ' {...
Using awk:
ls YDT:FILE* | awk -F: '
{
idx = $1 OFS $2
if ( A[idx] -lt $3 )
A[idx] = $3
else if ( ! ( A[idx] ) )
...
2,488
Posted By Subbeh
using awk: ls YDT:FILE* | awk -F:...
using awk:

ls YDT:FILE* | awk -F: '{a[$0]++};$3>d{d=$3}END{for(i in a){split(i,x,":");if(x[3]==d)print i}}'
3,178
Posted By RavinderSingh13
Hello Smile689, Could you please try the...
Hello Smile689,

Could you please try the following code hope it wil be helpful for you.




$ cat delete_latest_file.ksh

####Script starts from here#####
value=`ls -ltr | grep...
4,869
Posted By clx
Spaces on both side of "=" are necessary. if...
Spaces on both side of "=" are necessary.

if [ $str1 == $str2 ]

I believe ksh88 uses single "=" syntax though not sure.

if [ $str1 = $str2 ]

Further, to avoid syntax error in case any...
4,869
Posted By krishmaths
The if statement has to be modified as below as...
The if statement has to be modified as below as per syntax

if [ $str1 == $str2 ]

Without the spaces, it considers the expression as a string and evaluates to true as it is non-zero.
1,488
Posted By rbatte1
What you are doing is to execute the files. You...
What you are doing is to execute the files. You probably need something more like this:-#!/bin/ksh

for i in 19*
do
txt=`cut -c -6 $i`
echo "$txt"
doneThe cut command will get you the...
1,488
Posted By pamu
Hi, I have the files in the following files in...
Hi,
I have the files in the following files in a folder
19996587342
19487656550
19534838736
And i need to get the first 6 characters from the abvoe files
so i used the following script
...
6,293
Posted By Yoda
${file##*:} deletes the largest matching pattern...
${file##*:} deletes the largest matching pattern (matches from beginning) until colon :

Since I put asterisks * it deletes every character before that last colon :

For further reference:...
6,293
Posted By Yoda
You don't need an awk code inside for loop to do...
You don't need an awk code inside for loop to do this. You can use parameter substitution:
#!/bin/ksh

for file in pay*
do
file="${file##*:}"
print "$file"
done

If you are...
Showing results 1 to 25 of 38

 
All times are GMT -4. The time now is 08:26 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy