Search Results

Search: Posts Made By: bharath561989
1,895
Posted By Don Cragun
When you want to specify a range of times that is...
When you want to specify a range of times that is related to the start of a day instead of something that is a multiple of 24 hours from the time when you run your script, also consider using touch...
1,895
Posted By RudiC
Isn't that error message self explaining? As...
Isn't that error message self explaining?

As the -ctime argument specifies an interval of n*24h (counted from NOW) and not an absolute date, the command depends on the date/time it is run for...
1,895
Posted By Don Cragun
The standards don't have a file creation date in...
The standards don't have a file creation date in the stat structure, but some filesystem types do store that data. IOf your files are on are a filesystem that stores a creation timestamp AND your...
1,895
Posted By Chubler_XL
To properly compare these filename we should...
To properly compare these filename we should change the DDMMYYYYHHMMSS format to YYYYMMDDHHMMSS - I have written a function ymd that I use below to compare filesnames to the supplied ranges:

echo...
1,895
Posted By Chubler_XL
Will your range ever go over midnight or stretch...
Will your range ever go over midnight or stretch over more than one day?
1,895
Posted By jim mcnamara
Create two dummy files: dummy1 and dummy2, with...
Create two dummy files: dummy1 and dummy2, with filetimes you want

# syntax touch -t yyyymmddhhmm.ss
touch -t 201707031403.12 dummy1
touch -t 201707031403.40 dummy2

Now create a find...
5,197
Posted By greet_sed
Hi, IMO, command you have tried looks good...
Hi,

IMO, command you have tried looks good :b:
978
Posted By greet_sed
Hi, What are your attempts? Below one...
Hi,

What are your attempts?

Below one could be start point :

sed -e 's/Ç/C/;s/Õ/O/g' file

It gives desired output.

i added g for global replacement if same character has to be...
1,594
Posted By blastit.fr
Hi The find tool is really the best one for...
Hi
The find tool is really the best one for such process.
See:
$find tmp/ -type f -name '*' -exec echo File name is {} \;

# creation of 2 empty files
$ touch tmp/fileone tmp/filetwo
$ find...
5,197
Posted By Don Cragun
With any POSIX-conforming sed you could also use:...
With any POSIX-conforming sed you could also use:
sed -e 1n -e '$n' -e 's/^\(.\{179\}\)\([^I]\)/\1I\2/' "$file" > "$tmpf" && cp "$tmpf" "$file"
but RudiC's suggestion may be easier for some people...
1,594
Posted By Scrutinizer
Try: for file in /home/bharat/*.RET do ...
Try:

for file in /home/bharat/*.RET
do
if [ -f "$file" ]; then
echo "File Name= $file"
fi
done
5,197
Posted By RudiC
Try sed -e 1n -e '$n' -e '/^.\{179\}I/...
Try
sed -e 1n -e '$n' -e '/^.\{179\}I/ !s/./I&/180' file
5,197
Posted By RudiC
Don't touch that file or line?
Don't touch that file or line?
5,197
Posted By Don Cragun
If we just stick with standard sed addressing...
If we just stick with standard sed addressing constructs and do not depend on non-standard options, you could try something more like:
#!/bin/ksh
IAm=${0##*/}
tmpf="$IAm.$$"

trap 'rm -f...
5,197
Posted By greet_sed
Good that it works with last change. to make...
Good that it works with last change.

to make inplace/infile edit , use
sed -i '1n;$!s/./&a/10' $file

If you want to save a backup / copy of the file before modifying it, use
sed -i.bak...
5,197
Posted By greet_sed
Hi, It might be your version of sed / unix. ...
Hi,

It might be your version of sed / unix.

Tested in below versions and works fine:
sed --version
sed (GNU sed) 4.2.2
GNU sed version 4.1.5


can you please give a try as follows, if it...
5,197
Posted By greet_sed
Please use code tags for code snippet and quote...
Please use code tags for code snippet and quote tags for text input/output.

Example i gave is for file and it refers to line such as first , exclude last line.

sed -e '1{n};$!s/./&I/10' line is...
5,197
Posted By greet_sed
Hi, Can you please try similar to below one...
Hi,

Can you please try similar to below one ?Here i have simulated for 10th position in a file , excluding first and last line.

cat file
1234567890ABCD
1234567890XYZ
1234567890PQR...
Showing results 1 to 18 of 18

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