10 More Discussions You Might Find Interesting
1. UNIX for Beginners Questions & Answers
The requirement is i need to find an array value matching with pattern {5:{ , replace that with 5: and reassign that to same array index and print it.
I write something like below and the issue is sed command is not working. If i replace " with "`" the script gives syntax error.how can i... (8 Replies)
Discussion started by: bhagya123
8 Replies
2. 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
3. UNIX for Dummies Questions & Answers
What I want to do is delete everything upto the last underscore (_) in column 2.
awk '{ $2=$(echo $2 | sed 's/.*_//'); print $0}'
Sed works fine if I echo the string into it, this doesnt work inside awk. What am I doing wrong?
Similarly, how do I store the substring starting with a... (4 Replies)
Discussion started by: senhia83
4 Replies
4. Shell Programming and Scripting
Hi,
I was searching for a way to grep 2 lines before and after a certain keyword, and I came across the following code..
awk "\$0 ~ /ORA-/ {
cmd=\"awk 'NR>=\" NR-2 \" && NR<=\" NR+2 \"' init.ora\"
system(cmd)
}" input_file
I could not understand how this works. What is system() ? what... (2 Replies)
Discussion started by: Kulasekar
2 Replies
5. Shell Programming and Scripting
I'm brand new to awk and need your help.
I want to be able to shut down my workstations when they become to hot (because we've lost our cooling). I found a really neat way to monitor the temperature of the system and a short, simple awk scipt to use with it:
/usr/sbin/prtpicl -v -c... (2 Replies)
Discussion started by: natural
2 Replies
6. Shell Programming and Scripting
So, I have this script. It reads a CSV file that has a mixture of object names with IP addresses (parsing out that part I have working), and object names which have a DNS name. I want to be able to run a "dig +short" based off of the name given to me in the line of the awk script, and then deal... (6 Replies)
Discussion started by: mikesimone
6 Replies
7. Shell Programming and Scripting
Source File:
abcdefghijklmnop01qrstuvwxyz
abcdefghijklmnop02qrstuvwxyz
abcdefghijklmnop03qrstuvwxyz
abcdefghijklmnop04qrstuvwxyz
abcdefghijklmnop05qrstuvwxyz
Whatever characters are in 17-18 on each line of the file, it should be concatenated to the same line at the character number... (6 Replies)
Discussion started by: tamahomekarasu
6 Replies
8. Shell Programming and Scripting
Hi
I am using 'awk" to get file size and date of the file:
op - sundev3 $ ls -l /bb/bin/tsfiles.sel | awk '{print $5 $6 $7}'
1587May8
May be somobody knows the way to combine this command with variable assignmet inside the awk, so I would have variables SIZE, MONTH and DATE assigned after... (1 Reply)
Discussion started by: aoussenko
1 Replies
9. UNIX for Advanced & Expert Users
Hi,
Ho do I differentiate system call from library call?
for example if I am using chmod , how do I find out if it is a system call or library call?
Thanks
Muru (2 Replies)
Discussion started by: muru
2 Replies
10. UNIX for Dummies Questions & Answers
Hi,
this is my test file :
DELETE FROM TABLE
WHERE ID_INTERNAL = :TABLE.ID-INTERNAL, ID-INTERNAL-CRAZY
ID-INTERNAL-OPEN
ID-INTERNAL
/ID-INTERNAL/
I want all occurences of ID-INTERNAL replaced with a one, if ID-INTERNAL has and dash afer it , dont replace it example:... (6 Replies)
Discussion started by: seaten
6 Replies