Search Results

Search: Posts Made By: sweetnsourabh
5,297
Posted By sweetnsourabh
Hi Thanks that worled But I am still struggling...
Hi Thanks that worled
But I am still struggling for the new line character, i that can be done

Sweet

---------- Post updated at 10:18 AM ---------- Previous update was at 09:34 AM...
5,297
Posted By sweetnsourabh
Hi The command echo $OLD is giving...
Hi

The command echo $OLD

is giving following result /interface/PI/Output/

Which means $OLD is set. The command `date +"%Y%m%d"`Logs.txt is giving me the exact name of the file.

Please...
5,297
Posted By sweetnsourabh
Hi I am getting following error sed:...
Hi

I am getting following error
sed: 0602-410 The first regular expression cannot be null.
5,297
Posted By sweetnsourabh
Replace String
Dear Experts

I am creating a file using command

echo $vara > `date +"%Y%m%d`Logs.txt

this is putting following data in file

/interface/PI/Output/BPMCor_output20100303-124050-644.dat...
3,300
Posted By sweetnsourabh
Hi As a newbee I donot know how to reset...
Hi

As a newbee I donot know how to reset the TZ to current
Can I add the reset the original at the end of the code?
can you tell me that before I try your solution

Thanks
3,300
Posted By sweetnsourabh
Nested if with multiple conditions
Deal Experts

I am working on a script to find a date which is 7 days older and follwoing is my approach

#!/bin/sh
Yr=`date +"%Y"`
Mn=`date +"%m"`
Md=28
Da=`date +"%d"`
echo $Yr
echo $Mn...
10,701
Posted By sweetnsourabh
Hi I did'nt chmod my script I am...
Hi

I did'nt chmod my script

I am launching it by following command

$ /bin/sh new.sh
10,701
Posted By sweetnsourabh
Hi In the follwoing script -------- ...
Hi

In the follwoing script

--------
#!/bin/sh
var1=`date +"%Y%m%d"`
echo $var1
find . -name "*${var1}*" | xargs -I{} cp {} ./Delete/
--------
The command find . -name "*${var1}*" |...
10,701
Posted By sweetnsourabh
Hi Scot and ctsgnb Thanks for the guidance...
Hi Scot and ctsgnb

Thanks for the guidance at my early stage of shell learning.

As I mentioned erlier after using tr the ^M error is gone but the find command in the script is still not...
10,701
Posted By sweetnsourabh
Getting error: dos2unix: not found.
Getting error:

dos2unix: not found.
10,701
Posted By sweetnsourabh
hi I have made the correction and this...
hi

I have made the correction and this command works fine
But when i keep it inside my shell script it is throwing following error

-----
20101124
new.sh[5]: ^M: not found.
new.sh[6]: ^M:...
10,701
Posted By sweetnsourabh
find . -name "*${var1}*" | xargs -I cp {}...
find . -name "*${var1}*" | xargs -I cp {} ./Delete/

I have tried the above code inependently on the shell and it is throwing following error:

xargs: {}: A file or directory in the path name...
10,701
Posted By sweetnsourabh
Hi The current script looks like this ...
Hi

The current script looks like this
#!/bin/sh
var1=`date +"%Y%m%d"`
echo $var1
find . -name "${var1}*" -exec mv {} ./Delete/ \;OS: AIX mfkrv259 1 6

Path I want to search in and where...
10,701
Posted By sweetnsourabh
Hi Again this statement is not working...
Hi

Again this statement is not working inside the script but working in the command prompt

please help

Sweet

---------- Post updated at 02:29 PM ---------- Previous update was at 01:19...
10,701
Posted By sweetnsourabh
Hi Thanks for the quick reply, your code...
Hi

Thanks for the quick reply, your code has not thrown an error but has not moved any files in the /Delete folder either.

It has created a file {} of 0kb

I need to move all files to the...
10,701
Posted By sweetnsourabh
Find command in Shell Script
hi

I am a newbee in Shell scripting (hardly 7 days)
I have to execute a shell script which looks like this
#!/bin/sh
var1=`date +"%Y%m%d"`
echo $var1
find . -name "$var1*" -exec mv {}...
Showing results 1 to 16 of 16

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