10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hello folks,
I have multiple occurrences of the pattern:
).:
where is any digit, in various text context but the pattern is unique as this regex. And I need to turn this decimal fraction into an integer (corresponding percent value: the range of 0-100).
What I'm doing is:
cat... (1 Reply)
Discussion started by: roussine
1 Replies
2. Shell Programming and Scripting
Hi folks,
I have a scenario to convert the update statements into insert statements using shell script (awk, sed...) or in database using regex.
I have a bunch of update statements with all columns in a file which I need to convert into insert statements.
UPDATE TABLE_A SET COL1=1 WHERE... (0 Replies)
Discussion started by: dev123
0 Replies
3. Shell Programming and Scripting
I run my script "switch.sh" repeatedly (within 30 seconds). Each time script is triggered, script itself should kill all previous process.
Here is my code:
for pid in $(ps -fe | grep 'switch.sh' | grep -v grep | awk '{if ($2<$$) print $2}'); do
sudo kill -9 $pid
done
sleep 30
... (6 Replies)
Discussion started by: armatron
6 Replies
4. Shell Programming and Scripting
Hello
can you please help me with below script which is meant to delete clients from multiple netbackup policies
I want to run a command insdie awk statement
apparelnlty this script is not working for me
for i in $( cat clients_list)
do
bppllist -byclient $i | awk... (6 Replies)
Discussion started by: Sara_84
6 Replies
5. Shell Programming and Scripting
consider the script below
sh /opt/hqe/hqapi1-client-5.0.0/bin/hqapi.sh alert list --host=localhost --port=7443 --user=hqadmin --password=hqadmin --secure=true >/tmp/alerts.xml
awk -F'' '{for(i=1;i<=NF;i++){
if($i=="Alert id") {
if(id!="")
if(dt!=""){
cmd="sh someScript.sh... (2 Replies)
Discussion started by: vivek d r
2 Replies
6. Shell Programming and Scripting
Hello experts,
I'm stuck with this script for three days now. Here's what i need.
I need to split a large delimited (,) file into 2 files based on the value present in the last field.
Samp: Something.csv
bca,adc,asdf,123,12C
bca,adc,asdf,123,13C
def,adc,asdf,123,12A
I need this split... (6 Replies)
Discussion started by: shell_boy23
6 Replies
7. Shell Programming and Scripting
Hi,
I am using awk statement to extract data from a file and write a new file with certain columns rearranged and few hard coded values added to new file.
Now i need to add a column with sysdate. can i do that inside the awk print statement?
Now:
nawk ' /^3/ BEGIN {FS=","}... (2 Replies)
Discussion started by: selvankj
2 Replies
8. Shell Programming and Scripting
Hi,
I have a data file which contains record count.
So doing wc -l rightfit_balancing_count.dat | awk '{print $1}'] gives me the record count stored in the file.
Now, i want to send a mail from UNIX, if the record count is equal to 0,otherwise it should do nothing.
Any help... (2 Replies)
Discussion started by: Shell_Learner
2 Replies
9. UNIX for Dummies Questions & Answers
Hi,
It can be used awk inside other Awk?. I need to get another text processing while other text process.
Thank you. (2 Replies)
Discussion started by: pepeli30
2 Replies
10. UNIX for Dummies Questions & Answers
Hi Friends
How do I do two things from one if statement inside awk? I want to run a script and create a new file from the same condition.
awk '{ if ($2 == ""){print " "|"cd /local/test; ./script.ksh"}{cat > ran_true.txt}}' $IN_FILE
Bolded are the two things I want to be done.
Thanks (1 Reply)
Discussion started by: UNovIX
1 Replies