Search Results

Search: Posts Made By: gpk_newbie
9,869
Posted By gpk_newbie
Check if remote destination is available before running scp command
I have a script on a Linux box which scp the files to windows server without any issues. but there are time frames where the windows server will not be available due to maintenance. hence I need to...
3,370
Posted By gpk_newbie
sorry it has date and time in it cat...
sorry it has date and time in it


cat file.txt
16/02/21 10:29:34
3,370
Posted By gpk_newbie
Calculate time difference
I have time in a file in HH:MM:SS format as it contents(its not the file creation time). i need this to be converted to epoch time or time since 1970. The time is written into that file by a script,...
1,094
Posted By gpk_newbie
thanks a lot RavinderSingh13
thanks a lot RavinderSingh13
1,094
Posted By gpk_newbie
Hi RavinderSingh13 thanks a lot that worked...
Hi RavinderSingh13

thanks a lot that worked as required. Can you pls explain on how it works.
1,094
Posted By gpk_newbie
Grab text after pattern and replace
i have a file which contains data seperated by comma. i want to replace text after 3rd occurrence of a comma.
the input file looks like this


abcdef,11/02/2015...
1,291
Posted By gpk_newbie
Double slash into a file
I need to add double slash into a file using "echo" command.

I tried the below from the command line and it worked.


echo "\\\\abcd\efgh" > file



more file
\\abcd\efgh...
1,271
Posted By gpk_newbie
first do an "ls" on the files in the directory...
first do an "ls" on the files in the directory which u need to check the head.

Then loop the file names


#!/bin/bash
cd input_directory
ls -ltr | awk '{print $9}' | sed '/^$/d' >...
1,588
Posted By gpk_newbie
The below code will first check the unique...
The below code will first check the unique patterns in the first column and saves it to a file. it then checks for the unique pattern in the input file and stores all records matching pattern in a...
7,587
Posted By gpk_newbie
Thanks... It worked
Thanks... It worked
7,587
Posted By gpk_newbie
Passing value of variable to a query within shell script
I have a script in which i connect to database to run a query and get the result of the query to a temp file. This works fine , now what i want is there is flat file which contains the value to be...
1,584
Posted By gpk_newbie
find files for next day of the date entered
i have few files generated everyday with a date stamp. Sometimes it happens that if the files are generated late i.e after 00:00 hrs the date stamp will be of the next day.

example:
...
3,636
Posted By gpk_newbie
Print characters till the next space when the pattern is found
i have a file which contains alphanumeric data in every line. what i need is the data after certain pattern. the data after the pattern is not of fixed length so i need the data till the space after...
2,617
Posted By gpk_newbie
Thanks a lot agama. It works fine. and i...
Thanks a lot agama. It works fine.

and i found the solution for the other ques. just one more print command to print it.

gawk 'c-->0;/pattern/{print;c=7}' file1 > file2

---------- Post...
774
Posted By gpk_newbie
Thanks jayan_jay
Thanks jayan_jay
2,617
Posted By gpk_newbie
great this works fine. ---------- Post...
great this works fine.

---------- Post updated at 10:24 AM ---------- Previous update was at 09:45 AM ----------

Hi agama, i use the below command to get 7 lines after the pattern from file1 to...
774
Posted By gpk_newbie
Get 7 lines after the pattern
guys help me with the below. I run the below command to get 7 lines after the pattern in a file but im not able to include even the pattern into the file2.
gawk 'c-->0;/pattern/{c=7}' file1 > file2
2,617
Posted By gpk_newbie
Thanks a lot agama. but still i have a doubt will...
Thanks a lot agama. but still i have a doubt will this check for the latest update in the log file because there may be updates in logfile for previous days also.

---------- Post updated at 09:24...
2,617
Posted By gpk_newbie
Thanks agama. Let me try. ---------- Post...
Thanks agama. Let me try.

---------- Post updated at 08:20 AM ---------- Previous update was at 08:17 AM ----------

Thanks a lot agama. It works. But can you just explain briefly what it does
2,617
Posted By gpk_newbie
extract certain parts from a file
I have a logfile from which i need to extract certain pattern based on the time but the problem here is the time is not same for all days.

Input file:

Mon 12:34:56 abvjingjgg
Mon 12:34:57...
1,405
Posted By gpk_newbie
Thanks for the help. for the log file below can i...
Thanks for the help. for the log file below can i use the same awk command. and i want the output file to include the record updated both times.

1243
123214
wtewds
243243
bla bla...
1,405
Posted By gpk_newbie
read data from file from a specific duration
Hi,

i have log file which keeps on updating almost ever minute but i have certain string in log which will only be displayed between specific time. so i need to search for that string and copy the...
3,499
Posted By gpk_newbie
is the error string same at all times.
is the error string same at all times.
1,369
Posted By gpk_newbie
file is in .txt format. contents of the...
file is in .txt format.

contents of the file:

'abc@xyz.com,def@xyz.com,ghi@xyz.com ('abc@xyz.com,def@xyz.com,ghi@xyz.com')'
1,369
Posted By gpk_newbie
mail using mail address in a file
I have a file which contains few email address. I have few scripts which use the same mail address. so if any change in mail id like if any user do not want to receive the mail i can just edit a...
Showing results 1 to 25 of 29

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