Sponsored Content
Full Discussion: $LINENO no show
Top Forums Shell Programming and Scripting $LINENO no show Post 303021605 by annacreek on Monday 13th of August 2018 09:15:30 AM
Old 08-13-2018
'$LINENO is bash "system" variable but I cannot get any output trying to use it."


OK, I did not say "I am using bash ".

Yes, being a geenie I thought
# denotes comments, apparently not.


So I moved
#!/bin/bash back as first line in file



Here is a code snippet :



Code:
czechlist_DEBUG(){
  64 echo "czechlist_DEBUG "
  65 echo "Passed parameter #1 is $1"
  66 echo "Passed parameter #2 is $2"
  67 echo "Passed parameter #3 is $3"
  68 echo "Passed parameter #4 is $4"
  69
   70 echo "arg count = $#"
initialize while "count" 

   71 while [ $# -gt 0 ]
  72 do
  73     echo "$1 on $LINENO " 

 echoes "first" parameter "found" , so the construct 

is 

      while 

      do 

     ...
     done 

??

 
 
  74     shift
  75 done
  76 echo " DONE line output "
  77
  78 pause


And here is an output , getting there:



Code:
czechlist_DEBUG 
Passed parameter #1 is DEBUG USB 
Passed parameter #2 is lsusb
Passed parameter #3 is test par 2
Passed parameter #4 is test par 3
arg count = 4
DEBUG USB  on 73 
lsusb on 73 
test par 2 on 73 
test par 3 on 73 
 DONE line output 
Press [Enter] key to continue...


Last edited by annacreek; 08-13-2018 at 10:25 AM..
 

7 More Discussions You Might Find Interesting

1. UNIX Desktop Questions & Answers

Show us your Desktop

I don't see any threads like this and I know that a bunch of people have really cool desktops, so I`ll start. rules 1 no images in your post,attachments only 2 no default desktops, tha would be very much a waste (2 Replies)
Discussion started by: Genral
2 Replies

2. UNIX for Dummies Questions & Answers

Show path name

Hello I'm new to this forum. So please spare me! I'm using SCO UnixWare 7.1.4 and created a few accounts. So far so good. When I login I see: $. But here I want to see (for example), /home 25$ So I want to see the pathname where I am without each time typing pwd (2 Replies)
Discussion started by: p.vvugt
2 Replies

3. UNIX for Dummies Questions & Answers

ls how to not show date

Hello, I'm using ls -laR to print out a list of file and folders. I want to print only the permission, file size and file name. Also, excluding the '.' and '..'. result from ls -laR: total 6 drwxr-xr-x 8 user staff 512 Nov 28 16:17 . drwxr-x--- 16 user staff 1024... (3 Replies)
Discussion started by: minifish
3 Replies

4. Shell Programming and Scripting

Display LineNo Incase Total Number Of Delimiter Does matches in a given variable

I have many files .dat extension. requirement is to display line no if no of delimiter does not matches in a given variable lets say File: REF_BETOS.dat HCPCS_OR_CPT_CODE~BETOS_CODE~TERMINATION_DATE 0001F~Z2~ 0003T~I4~B20061231 0005F~Z2~~~ 0008T~P8~B20061231... (1 Reply)
Discussion started by: ainuddin
1 Replies

5. Shell Programming and Scripting

How to show the type of my terminal?

How to show the type of my terminal? Thanks in advance! (1 Reply)
Discussion started by: Henryyy
1 Replies

6. Post Here to Contact Site Administrators and Moderators

Show all my Posts?

Hello, Is there a way to display all of the posts I have authored? Many thanks in advance. (1 Reply)
Discussion started by: dlundwall
1 Replies

7. Homework & Coursework Questions

Show help

Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted! 1. The problem statement, all variables and given/known data: Display the contents of all files ending in a number to the screen 2. Relevant commands, code, scripts,... (2 Replies)
Discussion started by: marcincan
2 Replies
FORWARD_STATIC_CALL_ARRAY(3)						 1					      FORWARD_STATIC_CALL_ARRAY(3)

forward_static_call_array - Call a static method and pass the arguments as array

SYNOPSIS
mixed forward_static_call_array (callable $function, array $parameters) DESCRIPTION
Calls a user defined function or method given by the $function parameter. This function must be called within a method context, it can't be used outside a class. It uses the late static binding. All arguments of the forwarded method are passed as values, and as an array, sim- ilarly to call_user_func_array(3). PARAMETERS
o $function - The function or method to be called. This parameter may be an array, with the name of the class, and the method, or a string, with a function name. o $parameter - One parameter, gathering all the method parameter in one array. Note Note that the parameters for forward_static_call_array(3) are not passed by reference. RETURN VALUES
Returns the function result, or FALSE on error. EXAMPLES
Example #1 forward_static_call_array(3) example <?php class A { const NAME = 'A'; public static function test() { $args = func_get_args(); echo static::NAME, " ".join(',', $args)." "; } } class B extends A { const NAME = 'B'; public static function test() { echo self::NAME, " "; forward_static_call_array(array('A', 'test'), array('more', 'args')); forward_static_call_array( 'test', array('other', 'args')); } } B::test('foo'); function test() { $args = func_get_args(); echo "C ".join(',', $args)." "; } ?> The above example will output: B B more,args C other,args SEE ALSO
forward_static_call(3), call_user_func(3), call_user_func_array(3), is_callable(3), information about the callback type. PHP Documentation Group FORWARD_STATIC_CALL_ARRAY(3)
All times are GMT -4. The time now is 12:49 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy