mi2018 (OP)
Newbie
Offline
Activity: 37
Merit: 0
|
|
June 03, 2018, 09:08:31 PM |
|
what is this #!/bin/bash, I could not understand it, through cpp,
|
|
|
|
starmyc
Full Member
Offline
Activity: 198
Merit: 130
Some random software engineer
|
what is this #!/bin/bash, I could not understand it, through cpp,
I suggest you take a look at this wikipedia page: Shebang (Unix). The "#!" announces the script can be executed and its contents will be passed to the executable given and interpreted. C++ (cpp) is a compiled language. As #! is for interpreted files only (aka scripts), it is most likely you're not dealing with C++ but with a simple shell script.
|
|
|
|
r1s2g3
Sr. Member
Offline
Activity: 742
Merit: 395
I am alive but in hibernation.
|
|
June 04, 2018, 02:09:50 AM |
|
what is this #!/bin/bash, I could not understand it, through cpp,
This is shell script, Shell has many version and first line of code "#!/bin/<shell type> is to tell to which type of shell is used to execute that script. The most famous shell are korn shell (ksh) and bash shell (shell). Although unix scripts can execute in all shells but some commands (very small list) are very specific to that shell type so we need to give shell type in accordance. Otherwise "#" is used to comment in unix (if it is not first line in script and it is first character of that line).
|
I am alive
|
|
|
andrew1carlssin
Jr. Member
Offline
Activity: 168
Merit: 3
#Please, read:Daniel Ellsberg,-The Doomsday *wk
|
|
June 04, 2018, 03:54:34 AM |
|
Honestly, I am not a language specialist but I have a slightly preference for languages like ADA. from my textbook Dealing with overflows and underflows Because overflows and underflows can cause serious problems, some programming languages, such as Ada, proactively trigger an exception condition to alert the user that an underflow or overflow has occurred as the program is running. Others, such as C and C++, do not specify what will happen should an underflow or overflow occur, which means that the programmer cannot rely on getting any warning, or even consistent behaviour as their program is executing. Python, alongside some other programming languages, automatically bumps up the amount of storage as necessary to reduce the risk of an underflow or overflow occurring. Underflow and overflow situations can cause serious problems. In May 2015, the BBC published a story about the potential dangers of the Boeing 787 airplane engines switching themselves off mid-flight. The potential problem was found to be a 4-byte memory location that held a ‘count’ of how long the engines had been fired up. Calculations showed that this memory location would go into overflow sometime after the 248th day of continuous running, potentially causing the engines to lose power while in flight. Boeing immediately issued directives to ensure that the counters were regularly reset while they developed a software solution.
|
Satoshi's book editor; SCIpher - https://pdos.csail.mit.edu/archive/scigen/scipher.html
|
|
|
AGD
Legendary
Offline
Activity: 2070
Merit: 1164
Keeper of the Private Key
|
|
June 04, 2018, 06:17:44 AM |
|
what is this #!/bin/bash, I could not understand it, through cpp,
It doesn't matter as long as you understand the rest of the code. If you want to start coding and got stuck at shebang, you got a very long way ahead of you, jus sayn
|
|
|
|
ikatamoonshots
Jr. Member
Offline
Activity: 44
Merit: 2
|
|
June 04, 2018, 09:04:47 AM |
|
bash is the debian / ubuntu and other major linux distribution command line interface, all system and application commands are executed through the shell. for ex ./myscript.sh launches a script. You can pipe/ manipulate in/output in bash , for example using sed, awk or grep or inbuilt options see for example: https://www.thegeekstuff.com/2010/07/bash-string-manipulation/ You also can automate almost any system task using shell scripts May read this https://github.com/awesome-lists/awesome-bash
|
|
|
|
andrew1carlssin
Jr. Member
Offline
Activity: 168
Merit: 3
#Please, read:Daniel Ellsberg,-The Doomsday *wk
|
|
June 04, 2018, 10:04:07 AM |
|
bash is the debian / ubuntu and other major linux distribution command line interface, all system and application commands are executed through the shell. for ex ./myscript.sh launches a script. You can pipe/ manipulate in/output in bash , for example using sed, awk or grep or inbuilt options see for example: https://www.thegeekstuff.com/2010/07/bash-string-manipulation/ You also can automate almost any system task using shell scripts May read this https://github.com/awesome-lists/awesome-bash Good script, *nix still "the system" since Thursday, 1 January 1970, according my time-travel colleges John T, Barry Allen, et al .. Yes the cool thing about UTCnix pipe-lining is that you can concatenation of commands using the ascII symbol | For instance sometimes I want to generate a one-time password-nonce in order to no be so obvious across various websites .. so I can go using BTCash date +%s.%N | sha256sum | base64 | head -c 32 ; echo hope it can be useful. ps->Sure sky is the limit if you have a huge imagination
|
Satoshi's book editor; SCIpher - https://pdos.csail.mit.edu/archive/scigen/scipher.html
|
|
|
ikatamoonshots
Jr. Member
Offline
Activity: 44
Merit: 2
|
|
June 04, 2018, 10:48:38 AM |
|
date +%s.%N | sha256sum | base64 | head -c 32 ; echo cat /dev/urandom | tr -dc 'A-Za-z0-9!"#$%&'\''()*+,-./:;<=>?@[\]^_`{|}~' | head -c 28 | sha256sum | base64 | head -c 32 && echo ""
|
|
|
|
starmyc
Full Member
Offline
Activity: 198
Merit: 130
Some random software engineer
|
|
June 04, 2018, 05:19:04 PM |
|
date +%s.%N | sha256sum | base64 | head -c 32 ; echo cat /dev/urandom | tr -dc 'A-Za-z0-9!"#$%&'\''()*+,-./:;<=>?@[\]^_`{|}~' | head -c 28 | sha256sum | base64 | head -c 32 && echo ""
$ sudo apt install pwgen $ pwgen eiGh8voe eec7Gohc AhJ7euro ef2Riiz8 Saej7Oz3 dim3ahBo eitoo6Uo weeP3zea oop4UW4o Eiza8ooH shaeH8Ph pau6oaNg AeN4kie3 HaiPu7oh Ne5sahNg Sei2ahSe eet7Oor6 rohNg7yo yie8Ahsh Dahn6ooy choo5ieG ahM9ukai Em4ox2Pu Eiphan4o
(Fedora/Centos version is for sure dnf install -y pwgen) Cheers.
|
|
|
|
mi2018 (OP)
Newbie
Offline
Activity: 37
Merit: 0
|
|
June 04, 2018, 08:17:09 PM |
|
what is this #!/bin/bash, I could not understand it, through cpp,
This is shell script, Shell has many version and first line of code "#!/bin/<shell type> is to tell to which type of shell is used to execute that script. The most famous shell are korn shell (ksh) and bash shell (shell). Although unix scripts can execute in all shells but some commands (very small list) are very specific to that shell type so we need to give shell type in accordance. Otherwise "#" is used to comment in unix (if it is not first line in script and it is first character of that line). thank you very much that was helpfull
|
|
|
|
|