10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hello All,
I would like to ask help from you on how to pass variable value from a function that has been called inside the function. I have created below and
put the variables in " ". Is there another way I can do this? Thank you in advance.
readtasklist() {
while read -r mod ver... (1 Reply)
Discussion started by: aderamos12
1 Replies
2. UNIX for Dummies Questions & Answers
May i please know why is it printing the script name for $0 when i pass those parameters to function.
#!/bin/bash -x
usage()
{
echo "In Usage Function"
echo $0
echo $1
echo $2
}
echo "printing first time"
echo $0
echo $1
echo $2
usage $0 $1 $2
Output: (2 Replies)
Discussion started by: Ariean
2 Replies
3. Shell Programming and Scripting
Hello Friends,
I have written a script like below,
I aimed to move some CDR files (call data record) whose the last field is "1" (NF=1 ) from a spesific directory to a new directory
Field Seperator is pipe.
If the directory does not exitst i should create it.
I will give the script two... (5 Replies)
Discussion started by: EAGL€
5 Replies
4. Shell Programming and Scripting
The objective of this function is to validate the file full path.
cat /dev/null > crontab_NOTEXISTS.txt
function File_Existence # Accepts 1 parameter
{
file_name="$(echo $1)"
echo "${file_name}"
&& break || echo "$file_name NOT FOUND" >> crontab_NOTEXISTS.txt
}
while read file_name... (7 Replies)
Discussion started by: aimy
7 Replies
5. Shell Programming and Scripting
Hi all,
In the given script code .
I want to pass the maximum value that variable "i" will have in function DivideJobs () to variable $max of function SubmitCondorJob().
Any help?
Thanks
#!/bin/bash ... (55 Replies)
Discussion started by: nrjrasaxena
55 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
Could any one tell me how to use the system function in awk?
I want to use it to print the system date.
I have been trying like this :
yes |head -1|awk '{ system("date")}'
When I execute the above it always returns back to the prompt.
Your help would be much appreciated.
regards,... (3 Replies)
Discussion started by: srikanth_ksv
3 Replies
8. Shell Programming and Scripting
Hi ,
I have three funcions f1, f2 and f3 .
f1 calls f2 and f2 calls f3 .
I have a global variable "period" which i want to pass to f3 .
Can i pass the variable directly in the definition of f3 ?
Pls help .
sars (4 Replies)
Discussion started by: sars
4 Replies
9. Shell Programming and Scripting
Hi all,
I am calling a shell function within awk using system. I am struggling to get my expected output:
#!/bin/sh
set -o nounset
BEG=44
END=55
shfun()
{
echo "1|2|3"
}
export -f shfun
typeset -F > /dev/null
awk 'BEGIN {OFS="|"; print "'"$BEG"'",system( "shfun"... (5 Replies)
Discussion started by: jkl_jkl
5 Replies
10. Shell Programming and Scripting
Hi All,
Calling a function with one argument and storing the return value in a shell script is as below:( so far I know)
value="`fun_1 "argument1"`"
Its working perfectly for me.
Can u help me with passing more than one argument and storing the return value
Thnaks in advance
JS (1 Reply)
Discussion started by: jisha
1 Replies