10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
I have 7 functions those need to be executed as command line inputs, I tried with below code it’s not executing function. If I run the ./script 2 then fun2 should execute , how to initiate that function I tried case and if else also, how to initiate function from command line
if
then... (8 Replies)
Discussion started by: saku
8 Replies
2. Programming
hi
I want to write a function which takes int as input and returns a string like this.
char GetString(int iNo)
{
switch(iNo)
{
case 0:
return "Zero";
break;
case 1:
return "One";
break;
}
}
void main()
{
int i;
printf("Enter... (1 Reply)
Discussion started by: atharalikhan
1 Replies
3. Shell Programming and Scripting
Hi,
I would like to return the last part of a string in an array of strings in bash.
The array contains in each position the content below:
and I would like to return only the last part of each string.
The correct result would be:
How can I do that in bash using AWK?... (7 Replies)
Discussion started by: anishkumarv
7 Replies
4. Shell Programming and Scripting
function blah {
return "string"
}
it keeps saying string: not found
How can i do this guys? Because I'm trying to do something like this
function print_daemon_options {
echo "Start Daemons - Please enter one or a combination of the following:"
if isDatasubEnabled &&... (11 Replies)
Discussion started by: pyscho
11 Replies
5. UNIX for Dummies Questions & Answers
Hi,
I have a file with the following contents:
I need to create a script or search command that will search for this string 'ENDC' in the file. This string is unique and only occurs in one record. Once it finds the string, I would like it to return positions 101-109 ( this is the date of... (0 Replies)
Discussion started by: Lenora2009
0 Replies
6. UNIX for Dummies Questions & Answers
Hi,
I have a file with the following contents:
COMPANY ABCD
TRUCKER JOE SMITH
TRUCK 456
PLATE A12345678
TRUCKER BILL JONES
TRUCK 789
PLATE B7894561
I need to create a script or search command that will search for this string '789' in the file. This string is unique and only... (7 Replies)
Discussion started by: doza22
7 Replies
7. Shell Programming and Scripting
Hi ,
I m facing one problem with String usage in AWK . let me put what i need .
i have a function and there i used one string ( meta_string)
function 1 {
...................
...................
meta_string = " this string got... (1 Reply)
Discussion started by: madhaviece
1 Replies
8. Shell Programming and Scripting
Hy everybody
I'm trying to write a function like
function(){
final=$1
return $final
}
but I get following error:
"return: bad non-numeric arg ''"
what shall I do? Isn't it possible to return strings?:confused:
thanks
lucae (2 Replies)
Discussion started by: lucae
2 Replies
9. Shell Programming and Scripting
Dear All
I had below mention file as my input file.
87980457 Jan 12 2008 2:00AM 1 60 BSC1
81164713 Jan 12 2008 3:00AM 1 60 BSC2
78084521 Jan 12 2008 4:00AM 1 60 BSC3
68385193... (3 Replies)
Discussion started by: jaydeep_sadaria
3 Replies
10. Shell Programming and Scripting
Hi there
Does anybody know how to get grep to return the line underneath the string i am grepping for ie, if i have this file
hello
everybody
how
are
you
and i issue #cat file | grep how
I would like it to return the line below (in this case the string "are")
Is this... (2 Replies)
Discussion started by: hcclnoodles
2 Replies