Legal and illegal bash variable names?

 
Thread Tools Search this Thread
Homework and Emergencies Homework & Coursework Questions Legal and illegal bash variable names?
# 1  
Old 03-25-2014
Legal and illegal bash variable names?

list of legal and illegal bash variable names and wht each is either illegal and ligal?
















4. Seneca college, Toronto , Canada, peter wheeler, tech 154:
# 2  
Old 03-25-2014
Wrong forum!
# 3  
Old 03-25-2014
I think it is probably the correct forum, but the problem statement and display of work done to reach a resolution are missing???
# 4  
Old 03-25-2014
Apologies, I thought I saw the post in dummies...
# 5  
Old 03-25-2014
i havent tried for solution that why i am seeking for help
# 6  
Old 03-25-2014
We are willing to guide you to help you find a solution for your homework problems. However, we are not going to do your homework for you.

Even more importantly, we have to have a clear statement of what your assignment is! There is an infinite list of illegal bash variable names. I find it hard to believe that your professor wants an infinite list and another list that is, at least, HUGE.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Find matching file in bash with variable file names but consisent prefixs

As part of a bash the below line strips off a numerical prefix from directory 1 to search for in directory 2. for file in /home/cmccabe/Desktop/comparison/missing/*.txt do file1=${file##*/} # Strip off directory getprefix=${file1%%_*.txt} ... (5 Replies)
Discussion started by: cmccabe
5 Replies

2. Shell Programming and Scripting

Indexing Variable Names

Hi All I think I might have bitten off more than I can chew here and I'm hoping some of you guys with advanced pattern matching skills can help me. What I want to do is index the occurrence of variable names within a library of scripts that I have. Don't ask why, I'm just sad like that... ... (3 Replies)
Discussion started by: bbq
3 Replies

3. Shell Programming and Scripting

[SHELL: /bin/sh] For loop using variable variable names

Simple enough problem I think, I just can't seem to get it right. The below doesn't work as intended, it's just a function defined in a much larger script: CheckValues() { for field in \ Group_ID \ Group_Title \ Rule_ID \ Rule_Severity \ ... (2 Replies)
Discussion started by: Vryali
2 Replies

4. Shell Programming and Scripting

[CSH]legal to declare a variable like this

I am trying to declare a variable like this #!/bin/csh -f set c_arg = $a $b $c However, since i need it to declare before declaring $a ,$b or $c. As of now i am getting an error which says $a not defined. Is it possible to define a variable c_arg w/o interpreting the values $a $b $c (2 Replies)
Discussion started by: animesharma
2 Replies

5. Shell Programming and Scripting

script help Undefined /illegal variable using cat

Hello group, Still fairly new at the whole scripting thing so be gentle. I'm trying to write a simple script that archives my log files into a master log broken into weeks of the year. My script runs fine up till the "cat" lines which I get a undefined or illegal variable name error. But... (2 Replies)
Discussion started by: dpreviti
2 Replies

6. Shell Programming and Scripting

bash adding multiple names

Hi all, I make this bash script in which there is one option to add a name in txt file. So when I run the script it ask me for the name. When i enter the name, that name gets added in a txt file. If i add the same name again, the message comes up, the name is already there My question is..... (2 Replies)
Discussion started by: Learnerabc
2 Replies

7. UNIX for Dummies Questions & Answers

Incrementing Variable Names

Hi, I am using BASH. I have encountered a situation where the following is necessary (but I am not sure how to do it): #Define multiple arrays, whose names only differ by a number: ARRAY_1=(1 2 3) ARRAY_2=(4 5 6) ARRAY_3=(7 8 9) #Define ARRAY_AMOUNT, the number of arrays. In this case... (1 Reply)
Discussion started by: msb65
1 Replies

8. UNIX for Dummies Questions & Answers

Variable Names With Numbers

Hi Everyone, I was just curious if you are allowed to begin a variable name with a number. For example, I would really like to have the variable 8DAY_AVERAGE. But my shell script only seems to allow EIGHTDAY_AVERAGE. Is there a way I can get the former to work? I am using bash. Thanks a lot! ... (1 Reply)
Discussion started by: msb65
1 Replies

9. UNIX for Dummies Questions & Answers

Variable names

Hi, I have a variable v_iteration which can equal any 3 digit number eg 001 or 926 I would like to dynamically make a new variable name up using this 3 digit number eg v_another_variable_001=fred v_another_variable_926=joe The following are examples of what I have tried ... (2 Replies)
Discussion started by: Bab00shka
2 Replies

10. Shell Programming and Scripting

Variable names

Hi I have several variables called var1, var2, var3, var4 and so on. I would like to examine the contents of the variables using a loop and a variable called num which equals a figure eg num=3 I wanted to do something like echo $var$num to display the contents of var3 (4 Replies)
Discussion started by: Bab00shka
4 Replies
Login or Register to Ask a Question