Results 1 to 2 of 2

Thread: Variable problem

  1. #1
    Junior Member
    Join Date
    Oct 2003
    Posts
    1

    Variable problem

    I did a script for Red Hat Linux 8 and it worked perfect then I restarted my computer with KNOPPIX and I tried to run the script and is giving me the following problems:

    1) The script doesn't work if I dont add to the first line -xv or just -.
    Like that #!/bin/csh doesn't work
    Like that #!/bin/csh -vx works, and just with the dash (-) it works too. #!/bin/csh -

    Why is happened that? What can i do?

    2) When the program get to execute an intruction with the variable $#, it says that this variable doesn't exist.

    Should i use another variable to know if there's a parameter passed with the command line?
    Thank you for the answers :P

  2. #2
    Senior Member registered user
    Join Date
    Nov 2002
    Location
    USA, IL
    Posts
    1,041

    Re: Variable problem

    --Just so you know, most ppl on this board are probably using bash. (Unforch I don't know the answer to your question - but it does work now, right?)

    --I looked in the man page for csh, and the variable for arguments passed to the script is " $* ", same as bash. What is "$#" supposed to be? If you're looking for the number of words in a variable, it would be $#varhere.

    Quote Originally Posted by cborrero2000
    I did a script for Red Hat Linux 8 and it worked perfect then I restarted my computer with KNOPPIX and I tried to run the script and is giving me the following problems:

    1) The script doesn't work if I dont add to the first line -xv or just -.
    Like that #!/bin/csh doesn't work
    Like that #!/bin/csh -vx works, and just with the dash (-) it works too. #!/bin/csh -

    Why is happened that? What can i do?

    2) When the program get to execute an intruction with the variable $#, it says that this variable doesn't exist.

    Should i use another variable to know if there's a parameter passed with the command line?
    Thank you for the answers :P

Similar Threads

  1. Can't change environment variable pkg-config-path
    By SunnyB in forum General Support
    Replies: 0
    Last Post: 10-19-2004, 09:58 PM
  2. proxy environment variable?
    By activeco in forum General Support
    Replies: 2
    Last Post: 09-04-2004, 08:55 PM
  3. wrecked environmental variable found
    By Lex in forum General Support
    Replies: 0
    Last Post: 11-23-2003, 03:57 AM
  4. Wierd Problem With USB Keyboard, Maybe Motherboard Problem
    By Triple Six in forum Hardware & Booting
    Replies: 2
    Last Post: 04-15-2003, 04:23 AM
  5. Change LC_MESSAGES variable and change user name name
    By Guest in forum Customising & Remastering
    Replies: 1
    Last Post: 12-22-2002, 04:49 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


TP-Link TL-SG105 5-Port Gigabit Ethernet Unmanaged Metal Desktop Network Switch picture

TP-Link TL-SG105 5-Port Gigabit Ethernet Unmanaged Metal Desktop Network Switch

$19.99



Cisco Catalyst 2960-48TT-L 48-Port Fast Ethernet Managed Rackmount Switch picture

Cisco Catalyst 2960-48TT-L 48-Port Fast Ethernet Managed Rackmount Switch

$46.99



TP-Link TL-SG1048 48-Port Gigabit Rackmount Switch New Factory Sealed picture

TP-Link TL-SG1048 48-Port Gigabit Rackmount Switch New Factory Sealed

$199.99



NETGEAR GS308EP Essential Series 8-Port Gigabit PoE+ Unmanaged Switch picture

NETGEAR GS308EP Essential Series 8-Port Gigabit PoE+ Unmanaged Switch

$49.99



10-Port Gigabit PoE Network Switch with 8 PoE+ Ports with 2 Combo SFP Slots 125W picture

10-Port Gigabit PoE Network Switch with 8 PoE+ Ports with 2 Combo SFP Slots 125W

$39.99



5 Port Gigabit Unmanaged Ethernet Switch, Home Network Hub, Office Ethernet S... picture

5 Port Gigabit Unmanaged Ethernet Switch, Home Network Hub, Office Ethernet S...

$9.64



TP-Link TL-SG2210P 10-Port Gigabit Smart Switch w/ 8-Port PoE+ NO AC SKU 25597 picture

TP-Link TL-SG2210P 10-Port Gigabit Smart Switch w/ 8-Port PoE+ NO AC SKU 25597

$36.98



Arista DCS-7010T-48-R 48P 1GbE 4P 10GbE SFP+ RA Switch with rack mounts picture

Arista DCS-7010T-48-R 48P 1GbE 4P 10GbE SFP+ RA Switch with rack mounts

$69.00



Linksys LGS328MPC 24-Port Managed Gigabit PoE+ Switch with 4 10G SFP+ Uplinks picture

Linksys LGS328MPC 24-Port Managed Gigabit PoE+ Switch with 4 10G SFP+ Uplinks

$224.95



Cisco WS-C3650-12X48UR-L 48-Port Stackable Layer 3 8x10G SFP+ Port Switch picture

Cisco WS-C3650-12X48UR-L 48-Port Stackable Layer 3 8x10G SFP+ Port Switch

$129.99