Search Results

Search: Posts Made By: dsravan
1,504
Posted By dsravan
grab shell script error
How do I capture an error for any command I use.

For e.g if i try to zip a file and the file is not there. The regualr $? -gt 0 only tells its un-successful but won't tell me that the file is...
10
3,345
Posted By dsravan
thanks. this works only to get the date for...
thanks. this works only to get the date for present day -1

I want to get it for any date that is present

for e.g... if i have 20120704 i want to get 20120703
10
3,345
Posted By dsravan
Linux and ksh
Linux and ksh
10
3,345
Posted By dsravan
date -1
I have date in the format YYYYMMDD

I need to subtract 1 day from this and get the date in the same format as YYYYMMDD

How can I do that?
942
Posted By dsravan
Moving files to different date files
I have files as below



I need to have all the files renamed as below



There are 100 of files like this. How can I do this?
1,048
Posted By dsravan
tks pravin27. I have one quick question. ...
tks pravin27. I have one quick question.

After I get the decrypted files i need to encrypt them. I need to attach .pgp at the end of the filenames i just derived. How can I do that.
1,048
Posted By dsravan
this is truncating the directory path it needs to...
this is truncating the directory path it needs to write to. I don't know where the file is being written to

---------- Post updated at 01:51 PM ---------- Previous update was at 01:40 PM...
1,048
Posted By dsravan
Tks. But i have many files in there and I need...
Tks. But i have many files in there and I need to derive it with the cut and echo command for each file o\p
1,048
Posted By dsravan
problem with output re director to a file
I have a file named XXX_TEF_20120530234576.txt.pgp

I am creating a new file with the below syntax but looks it doesnt like the redirection

for file in XXX_TEF_20120530234576.txt.pgp ;do;
echo...
1,023
Posted By dsravan
I need the parameter to resolve to the full file...
I need the parameter to resolve to the full file name.

the * resolves to hours minutes in the file name

I don't want a * in the run time.

I want the FILE value to resolve to the full...
1,023
Posted By dsravan
help with date parameter
I have a file with timestamp in the file name

FILE=DETAIL_20120419141952_CODE.txt

I am using the below expression to derive the file name

FILE=DETAIL_$(date +'%Y%m%d')*_CODE.txt

echo...
937
Posted By dsravan
help with script parameter checking based on environment
I need to check if the parameters are correctly passed based on the Environment I am in.

For e.g when I am in dev the 1st paramter needs to be either A OR B OR C OR D
similarly when I am in qa...
3,979
Posted By dsravan
i am using ksh
i am using ksh
3,979
Posted By dsravan
help with assigning multiple values to a variable
I have a situation where my variable needs to pick up any of the 4 values from the environment it is in

for e.g i am on server named a

server=a (script running on this server)
ftp servers= b c...
1,227
Posted By dsravan
selective replacement of delimiter
I have a file with two fields seperated by comma

data looks like below with the header



The o/p should look like this



Basically, the req is to replace only the first occuring comma...
1,295
Posted By dsravan
running a script only till a point in a day
how can i run the script if its less than a particular time only in unix.

for e.g the script kicks off at 9AM and looks for some file etc. I want to make sure it runs only till 12PM and then...
837
Posted By dsravan
help with while loop
I need a while loop that checks for a file existence if it exists it exits with 0 rerturn code, if not it shold check to see if its last day of the month then wait and check for every 5 mnutes
until...
1,631
Posted By dsravan
Aigles I am doing only the below commands ...
Aigles

I am doing only the below commands






How can I make sure I have same number of record count after using awk command?

---------- Post updated at 11:05 AM ---------- Previous...
1,631
Posted By dsravan
Scottn, I didn't really get it. what do you...
Scottn,

I didn't really get it. what do you mean by original file missing new line?:confused:
1,631
Posted By dsravan
problem with awk command
I am having problem running an awk commad on a file
Before applying awk command on the file


After applying


I don't expect more than 409743 records in the file. Why do I have 1 record more...
1,445
Posted By dsravan
Help with cleansing data
I have a file with 27 fields seperated by pipe. I have a field 17 that is defined as numeric and the data coming in might contain character and
other miscellaneous data like (@,!,~,#,%,^,&,*,(,)). ...
2,402
Posted By dsravan
Thanks Scottn and bartus
Thanks Scottn and bartus
2,402
Posted By dsravan
scottn, I am getting below error with your...
scottn,

I am getting below error with your command



---------- Post updated at 01:42 PM ---------- Previous update was at 01:40 PM ----------

got it. figured out
2,402
Posted By dsravan
help with search and replace in multiple fields
I have a pipe delimited file with 27 fields. Each record has 26 fields. I need to search for the 25,26,27 fields and replace "," with nothing.

How can I acheive this. Sed is more preferred.
...
1,621
Posted By dsravan
Thanks Vgresh. Is there a way we can do it in...
Thanks Vgresh. Is there a way we can do it in sed. I am using couple of other sed commands on the file. Hence would like to see if we can do it in sed.
Showing results 1 to 25 of 244

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