10 More Discussions You Might Find Interesting
1. UNIX for Beginners Questions & Answers
My requirement is to call function ("fun1") from awk, and print its returned value along with $0.
fun1()
{
t=$1
printf "%02d\n", $t % 60;
}
echo "Hi There 23" | awk '{print $0; system(fun1 $3)}'
Any suggestions what to be modified in above code to achieve requirement.. (5 Replies)
Discussion started by: JSKOBS
5 Replies
2. Shell Programming and Scripting
In the below script i found that the alias mkdir_s is getting invoked from function configure() i.e the alias is kicking in.
#!/bin/bash -e
shopt -s expand_aliases
alias mkdir=mkdir_s
mkdir_s(){
if ]; then
return
else
/usr/bin/mkdir "$1"
return
fi
}
configure()
{
mkdir -p... (9 Replies)
Discussion started by: mohtashims
9 Replies
3. Shell Programming and Scripting
Hi, guys,
The content of file is below (from <UNIX® Shells by Example Fourth Edition>):
My code is below:
gawk -F'' ' { OFS = "****"; $3 = "(904)"; $8 = $5 + $6 + $7; print } ' lab3.data
The result is below:
So, where is the $1? Why is the variable $8 located at the wired position? (3 Replies)
Discussion started by: franksunnn
3 Replies
4. Shell Programming and Scripting
Hi folks,
is there any recommendation, especially from a point of performance, about where to place a user-defined function in awk, like in BEGIN{} or if it is only need once at the end in END{}? Or doesn't it matter at all since, awk is so clever and only interprets it once, wherever it is... (3 Replies)
Discussion started by: zaxxon
3 Replies
5. Emergency UNIX and Linux Support
File: A.h
class A
{
public:
struct x X;
int show()
{
x.member_variable ? 0: -1;
}
};
Now if A.cpp is complied which includes A.h (which is actually in a huge project space) we see that x.member_variable value is not as expected. But if remove the show() method and place... (4 Replies)
Discussion started by: uunniixx
4 Replies
6. Shell Programming and Scripting
Imagine a user-defined function.
func() { /usr/pkg/bin/program long-string-of-switches-and-configs "$@" ;}
I execute it once. Then background it.
I execute another instance. Then bg it.
func unique-user-input
^Z
func unique-user-input
^Z
First I view with ps
ps wwaux
... (0 Replies)
Discussion started by: uiop44
0 Replies
7. Shell Programming and Scripting
Hello Friends,
Is it possible to return an array from a user defined function in awk ?
example:
gawk '
BEGIN{}
{
catch_line = my_function(i)
print catch_line
print catch_line
print catch_line
}
function my_function(i)
{
print "echo"
line= "awk"
line= "gawk"... (2 Replies)
Discussion started by: user_prady
2 Replies
8. Shell Programming and Scripting
I am working on a SunFire 480 - uname -a gives:
SunOS bsmdb02 5.9 Generic_112233-08 sun4u sparc SUNW,Sun-Fire-480R
I am tyring to sum up the total size of all the directories for each running database using awk:
#!/usr/bin/ksh
for Database in `ps -efl | grep "ora_pmon" | grep -v grep |... (1 Reply)
Discussion started by: jabberwocky
1 Replies
9. UNIX for Dummies Questions & Answers
I want to add a new IP service which executes a script on SCO OS5.
I have amended /etc/services and added to port number (3333)
I have amended /etc/inetd.conf and added a line for this service but I can't get it to execute my own shell script
When I telnet to the IP address on port 3333 I... (1 Reply)
Discussion started by: markdrury
1 Replies
10. AIX
Hi,
I am just running a incremental back-up on one of my server.
But these days It abrubtly fails with below error.
==========
User defined signal 1
===========
When I rerun the back-up, It completed successfully.Earlier this was not happening.
Any Idea, what could be the problem... (0 Replies)
Discussion started by: nitesh_raj
0 Replies