Understand Bash scripting encryption


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Understand Bash scripting encryption
# 1  
Old 09-14-2008
Question Understand Bash scripting encryption

Dear all,

I have been working with Linux for quite few years but never required to learn Bash and Linux really dep doan.
I want to learn bash I bought books and Have been reading on the Internet but I cannot find my answers, maybe I am blind.

For example:
What does this means?
# for i in Smilie
Where can I find what the "i" and the "in" means and their significance.
I need to nderstand where they come from and where can I find all of them, for example sometimes I see "# while -n blabla" what "-n" mean and where can I find explanations for similar things?

If you guys could give me some light I would be really happy and thankful.

Cheers
# 2  
Old 09-14-2008
This is an excellent tutorial for bash scripting:

Advanced Bash-Scripting Guide

Check the section of Loops and Branches (Part 3.10).

Regards
# 3  
Old 09-14-2008
Thank you for the reply.
The problem with that tutorial is it does not explain where does the "in" come from all the rest of it.
Another example: for a in blabala

Where does the "A" come from where can I find al the possibilities, such as: ! [] {} () . in a i arg exec, things like that, I would like to understand them.
I'will give an example to you which for me does not say anyting: Smilie){ :|:& };:

I would say that a kid was playing with the keyboard. But I tried the combination on my Linux box and it killed my box, had to re-start it.

I would like something which explains all the symbols etc.

Thank you very much

Best regards
# 4  
Old 09-15-2008
In that particular case, the "in" word is a reserved word.
someone, while developing bash, decided to make it so.
the loop structure requires some special words to fit in all the options.
"for" is a reserved words that tells bash, a loop is about to be "declared"
the next param, is the variable that bas will use to hold the step
in tells bash that the next thing is the list to go trough. one loop for each object. on each iteration, the current value is asigned to the variable after the for but before the in
(all this is in the link frankling posted)

that "kid smashing the keybord" is caled "fork bomb"
is a clever way to name functions with weird names (like : ), more data here
Fork bomb - Wikipedia, the free encyclopedia

but the advanced bash scripting guide is very very good, and im sure it has most of what you want.
# 5  
Old 09-15-2008
for a in blabla
for z in blabla
for apples in barrel
for cars in garage
for people in city

As you step through a script, the first time that the variable is called, it tells the script to assign the first entry in the file/array/something to $a or $b or $apples etc.
Once the script has completed the loop, it will ask for the next element. The script looks at the file/array/something and assigns the next value to $a/$b/etc. and the script runs the loop again. It will continue this until you run out of apples/people/elements.
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

How to understand special character for line reading in bash shell?

I am still learning shell scripting. Recently I see a function for read configuration. But some of special character make me confused. I checked online to find answer. It was not successful. I post the code here to consult with expert or guru to get better understanding on these special characters... (3 Replies)
Discussion started by: duke0001
3 Replies

2. Shell Programming and Scripting

I am learning shell scripting and i would like to understand how sort -k3,3 -k 4,4 short* works

Please help me understand how sort -k3,3 -k 4,4 short* works , is it sorting 3 and 4 th field ? what is the use of specifying 3,3 and 4,4 in sort and what is actually does and i see sort -k3 short* and sort -k3,3 -k 4,4 short* giving the same output. Sort output attached Please help (2 Replies)
Discussion started by: Antony Ankrose
2 Replies

3. Cybersecurity

File encryption tools with MAC address as an encryption key

Hi all, I'm looking for secure file encryption tools that use MAC address as encryption key. FYI, I'm using Red Hat Enterprise Linux OS. For example: when A wants to send file to B A will encrypt the file with B's computer MAC/IP address as an encryption key This file can only be decrypted... (2 Replies)
Discussion started by: sergionicosta
2 Replies

4. Shell Programming and Scripting

Learning curve to understand bash iteration

Hi Folks, I know on one side there is script and on another side there is smart script. I am able to achieve what I got but thought there has to be a code which doesn't require multiple lines. So if you guys can help me out than it will be awesome. Also I wrote in cshell but if can get both the... (4 Replies)
Discussion started by: dixits
4 Replies

5. UNIX for Dummies Questions & Answers

Another Simple BASH command I don't understand. Help?

I have a text file called file1 which contains the text: "ls -l" When I enter this command: bash < file1 > file1 file1 gets erased. However if I enter this command: bash < file1 > newfile the output from "ls -l" is stored in newfile. My question is why doesn't file1's text ("ls -l") get... (3 Replies)
Discussion started by: phunkypants
3 Replies

6. Shell Programming and Scripting

Do not understand why my while loop fail (bash)

Hi again :) I still need your help now... #!/bin/bash SIZE=`ls -s text.txt` while do done My problem is that the line "while ..." still print the same value after the first loop. In one instruction change the size of text.txt I've run my bash script in debug mode, and the... (6 Replies)
Discussion started by: Link_
6 Replies

7. Shell Programming and Scripting

I want to understand bash better

Hi everyone, I have some questions regarding bash and my initializer files: when I look at my bashrc file, I see lots of "export".. export MAGICK_HOME="$HOME/bin..etc".. what does export really mean? in my bashrc, I have a line: "umask 0002" ... what does that do? I have a bash_profile... (6 Replies)
Discussion started by: patrick99e99
6 Replies

8. Shell Programming and Scripting

bash shell: 'exec', 'eval', 'source' - looking for help to understand

Hi, experts. Whould anybody clear explay me difference and usage of these 3 commands (particulary in bash) : exec eval source I've tryed to read the manual pages but did not get much. Also could not get something useful from Google search - just so much and so not exactly, that is... (3 Replies)
Discussion started by: alex_5161
3 Replies

9. UNIX for Dummies Questions & Answers

File encryption/Key encryption ????

My dilemma, I need to send, deemed confidential, information via e-mail (SMTP). This information is sitting as a file on AIX. Typically I can send this data as a e-mail attachment via what we term a "mail filter" using telnet. I now would like to somehow encrypt the data and send it to a e-mail... (1 Reply)
Discussion started by: hugow
1 Replies
Login or Register to Ask a Question