Search Results

Search: Posts Made By: smile689
1,770
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,175
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...
7,175
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,175
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.
2,583
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...
19,952
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 \;
3,818
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,133
Posted By hergp
... for File in $Src_Dir/$File_nm* ...
...
for File in $Src_Dir/$File_nm*
...
1,133
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"...
4,261
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,393
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,175
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,175
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,202
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,202
Posted By vidyadhar85
there is no not command in ksh. try ! or test
there is no not command in ksh. try ! or test
2,133
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,133
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,133
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}}'
2,817
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,160
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.
4,160
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...
1,295
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
...
1,295
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...
5,911
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:...
5,911
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 03:14 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy