Search Results

Search: Posts Made By: rohit_shinez
16,135
Posted By rohit_shinez
Transpose into single record
Hi Guys,

I have a file like below format

/my_dir/logs 2018-08-02 15:19:54 accepted connection from 10.140.75.239
/my_dir/logs 2018-08-02 15:19:56 authentication failed for id '123':...
6,390
Posted By rohit_shinez
I am getting below error bash-3.2$ echo...
I am getting below error

bash-3.2$ echo $input
nz
bash-3.2$ echo '@code_temp_table_$value_table'| sed -r "s/\@code/${input}/; /^(nz|sa)_/s/\\\$value_/\$value1_/"
sed: illegal option -- r...
5,259
Posted By rohit_shinez
Yes you are correct it should be |||| , and is...
Yes you are correct it should be |||| , and is there a generic way to replace the special characters apart from §, I mean if I get any other special character
5,259
Posted By rohit_shinez
Special character replacement
Hi Guys,
I have a file which needs to be replaced with tab delimited


AA§Orgin Name§Mapping based on prod_usa§§§§
BB§Date§2019-08-11 23:30:01§§§§


I am trying below code


sed 's/[ -~...
31,398
Posted By rohit_shinez
I completely agree with your approach which...
I completely agree with your approach which handles all type of scenarios. Thanks guys for your help
19,348
Posted By rohit_shinez
I think its not getting sorted properly ...
I think its not getting sorted properly


{ read; echo $REPLY; sort -t"|" -k7bg; } </tmp/salary.txt
EMPNAME | SALARY | Q1 | Q2 | Q3 | Q4 | Avg Q | Expected Sal | Incremented Sal | Performance |...
19,348
Posted By rohit_shinez
Thanks a lot for your inputs, I would like to...
Thanks a lot for your inputs, I would like to sort into descending order based one Avg Q while displaying the table

cat /tmp/salary.txt| sort -k 7


While using above code i am not able to sort...
19,348
Posted By rohit_shinez
Thanks for the inputs, In python is there a way...
Thanks for the inputs, In python is there a way to make it effective code or any other alternative approach
19,348
Posted By rohit_shinez
Agree to that, But would more keen on bash...
Agree to that, But would more keen on bash scripting for learning purpose
19,348
Posted By rohit_shinez
Thanks for your inputs, I am mainly looking for...
Thanks for your inputs, I am mainly looking for the same program to work on unix bash script. Can you able to help how i can achieve it instead of python code
19,348
Posted By rohit_shinez
Thanks Guys for your comments, I would like to...
Thanks Guys for your comments, I would like to know whether in unix bash script this can be done in efficient way. Can you guys help
19,348
Posted By rohit_shinez
Calculate the performance of employee
Hi Guys,

I need to determine the employee performance and calculate their salaries based on each quarter

Expected output

enter the no. of Employee 2
2
Enter Employee Name sam
Enter...
31,398
Posted By rohit_shinez
To print diamond asterisk pattern based on inputs
I have to print the number of stars that increases on each line from the minimum number until it reaches the maximum number, and then decreases until it goes back to the minimum number. After...
5,144
Posted By rohit_shinez
Hi Don, Its bash and Linux flavour, ...
Hi Don,

Its bash and Linux flavour,

for success scenario it will not return any exit because there will be scenario where daily and 25th will come in same time.

If the script_1.sh fails...
5,144
Posted By rohit_shinez
Let me explain you clearly. The expectation of...
Let me explain you clearly. The expectation of script_1 - every month 25th it would run. Script_2 - every day and script_3 every quarterly month end. For eg. if script_1 fails due to any reason on...
5,144
Posted By rohit_shinez
Here is what i am trying ...
Here is what i am trying


current_day=$(date +%e)
current_time=$(date +"%H:%M")
current_month=$(date +"%m")

if [ $current_day == 25 ] && [ $current_time == '10:00' ]
sh -x...
5,144
Posted By rohit_shinez
what if script_1.sh fails then if i rerun the...
what if script_1.sh fails then if i rerun the main_script.sh it should run only script_1.sh . For eg script_1.sh fails on 25th and re-running on 26th in that case script_1.sh will not run and other...
5,144
Posted By rohit_shinez
I know its possible in crontab but can it be...
I know its possible in crontab but can it be handled in script itslef like before trigerring each of the sub scripts
5,144
Posted By rohit_shinez
Run script on particular day without crontab
Hi Guys,

I am having a driving script which calls internally multiple scripts



sh main_script.sh > main_script.log

inside main_script.sh

sh -x script_1.sh

sh -x script_2.sh

sh...
5,295
Posted By rohit_shinez
Sorry to below example the lenght are fixed like ...
Sorry to below example the lenght are fixed like
Country - will accept only 20 characters
id - 20 characters
role - 20 characters


country,id,role
Australia,1234,engineer...
5,295
Posted By rohit_shinez
Basically the text file have fixed length like...
Basically the text file have fixed length like country - 1-20,id 21-25,role - 26-30.
Country - will accept only 20 characters
id - 5 characters
role - 5 characters
5,295
Posted By rohit_shinez
Thanks don, Is there a way i can predine the...
Thanks don, Is there a way i can predine the columns length in shell, because here there are two columns. What if the columns are increased and the length needs to be defined accorindly instead of...
5,295
Posted By rohit_shinez
Converting csv file to flat file
Hi All,

I have a csv file which is comma seperated. I need to convert to flat file with preferred column length


country,id
Australia,1234
Africa,12399999



Expected output

country...
2,262
Posted By rohit_shinez
Replace value from input parameter
Hi Guys,

I am having a script file where in getting input parameter as string. I need to assign the variable but not able to achieve


#!/bin/bash

input=$1

replace=string_$input_string2...
5,807
Posted By rohit_shinez
How to check total files size in hdfs directory?
Is there a way to calculate the total file size of HDFS file directory in GB or MB? I dont want to use du/df command. Without that is there a way



HDFS
Directory - /test/my_dir
Showing results 1 to 25 of 220

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