Search Results

Search: Posts Made By: lazydev
1,085
Posted By lazydev
Tried with a simple file but it didn't return any...
Tried with a simple file but it didn't return any data


> cat sam.out
Avinash 2015-01-02-15.25.28.993000
Avinash 2015-01-02-15.25.29.018000
Avinash 2015-01-02-15.25.29.376000
Avinash...
1,085
Posted By lazydev
Need help in arranging data
I have a file with user activity and need to display only the start and end timestamp of the activity. I don't know how can we write an logic for this please help me in a bettr way to work on it
...
2,107
Posted By lazydev
Thank you . I got the option it's -r
Thank you .
I got the option it's -r
2,107
Posted By lazydev
Hide from adress while sending emails
I have a shell script that sends email alerts to all the teams if there's any issue identified .

This is the command that I use to send email alerts to others


cat out.out | mail -s...
1,443
Posted By lazydev
Sort based on numbers
I have a file which has the following data :-



how can I sort the data in descending order .



My files may have the first column with 1 to 10000 numbers .I need to arrange them in...
4,303
Posted By lazydev
How to append server name to everyline?
I am executing df -mP to see the disk utilization.
I would like to append servername also to each and every line.


df -mP | awk '{ print $1","$2","$3","$4","$5","$6 }'



trying to...
2,307
Posted By lazydev
After checking found that combining database...
After checking found that combining database commands with unix commands it's not working .

db2 "call get_dbsize_info(?,?,?,-1)" | awk -F": " '/DATABASESIZE/ {print $3}' RS=
db2 "call...
2,307
Posted By lazydev
Had no luck with the above syntax so Here's the...
Had no luck with the above syntax so Here's the db2 command output :-


db2 "call get_dbsize_info(?,?,?,-1)"

Value of output parameters
--------------------------
Parameter Name :...
2,307
Posted By lazydev
Only the first line gives me the output and rest...
Only the first line gives me the output and rest 2 doesn't.

---------- Post updated at 05:35 PM ---------- Previous update was at 05:09 PM ----------

looks to be an issue with sed -n
...
2,307
Posted By lazydev
Added one more line with echo :- db2...
Added one more line with echo :-


db2 "call get_dbsize_info(?,?,?,-1)" | sed -n '8p' | awk -F : '{print $2}'
echo $(db2 "call get_dbsize_info(?,?,?,-1)" | sed -n '8p' | awk -F : '{print...
2,307
Posted By lazydev
Unable to assign a value
I have written a shell script to calculate dbsize :-


db2 "call get_dbsize_info(?,?,?,-1)" | sed -n '8p' | awk -F : '{print $2}'
dbsize=`db2 "call get_dbsize_info(?,?,?,-1)" | sed -n '8p' |...
1,100
Posted By lazydev
That works can I generate them dynamically by...
That works can I generate them dynamically
by giving hostname and whoami commands



awk '{printf("%s",NR%4 ? $0",":$0",`hostname`,`whoami`\n")}' 1.sql


It gives me the same
1,100
Posted By lazydev
Add two more fileds to awk command
This is what I was trying but failed to do so need help.



cat 1.sql | awk '{printf("%s",NR%4 ? $0",":$0"\n")}'


Output :-



I want to add 2 more values for each line...
2,151
Posted By lazydev
Convert rows to columns
I am looking to print the data in columns and after every 3 words it should be a new row.





cat example.out | awk 'END { for (i = 0; ++i < m;) print _[i];print _[0] }{ _[NR % m] = _[NR...
3,099
Posted By lazydev
Convert data to a tabular format
How can i convert the below data to a simpler format :-


cat tabular.txt

User 1 Details :-
First Name = Tom
Middle Name =
Last Name = Hanks
Age = 40
Address =
User 2 details :-
...
973
Posted By lazydev
I am having two strings one is list of names &...
I am having two strings one is list of names & other is an attribute related to them i just need to match them .it's just like 1-1,2-2,3-3,4-4 if no element exists then it would be null



I...
973
Posted By lazydev
for loop
I am trying to write a code to match words from two strings and this is the code i have written

for d in `echo boy,girl | tr ',' '\n'`
do

for i in `echo alex,rose | tr ',' '\n'`
...
1,260
Posted By lazydev
I have changed the script as fnPingFunction...
I have changed the script as
fnPingFunction "localhost" echo $resultbut it still shows me the same
1,260
Posted By lazydev
how to retrun a value from a function in shell script
fnPingFunction()
{
ping -c1 $1
if [[ $? = 0 ]]
then result = 'Y'
else
result = 'N'
fi
}
value=$(fnPingFunction "localhost")
echo $value
How do i get the value from the function ? ...
1,596
Posted By lazydev
format change
I have a text file sample.txt which contains some details like

Order
9001
Item Code
34
Quantity
4
Entry Date
2009-04-23
Ordered by
Ram


Order
9002
Item Code
34
Quantity
3
1,862
Posted By lazydev
State of a table space cannot be predicted by...
State of a table space cannot be predicted by using the systablespaces tables.Therefore i am going for the script .
1,862
Posted By lazydev
change the output format
when i run the following command


db2 list tablespaces

Tablespaces for Current Database

Tablespace ID = 0
Name =...
Showing results 1 to 22 of 22

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