Bitcoin Forum
May 06, 2024, 03:46:15 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: what is this #!/bin/bash  (Read 173 times)
mi2018 (OP)
Newbie
*
Offline Offline

Activity: 37
Merit: 0


View Profile
June 03, 2018, 09:08:31 PM
 #1

what is this #!/bin/bash,  I could not understand it, through cpp,
1715010375
Hero Member
*
Offline Offline

Posts: 1715010375

View Profile Personal Message (Offline)

Ignore
1715010375
Reply with quote  #2

1715010375
Report to moderator
1715010375
Hero Member
*
Offline Offline

Posts: 1715010375

View Profile Personal Message (Offline)

Ignore
1715010375
Reply with quote  #2

1715010375
Report to moderator
Once a transaction has 6 confirmations, it is extremely unlikely that an attacker without at least 50% of the network's computation power would be able to reverse it.
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
starmyc
Full Member
***
Offline Offline

Activity: 198
Merit: 130

Some random software engineer


View Profile
June 03, 2018, 09:14:38 PM
Merited by achow101 (2), LoyceV (1), HCP (1)
 #2

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.

Hi, I'm just some random software engineer.
You can check my projects: Bitcoin & altcoin balances/addresses listing dumps: https://balances.crypto-nerdz.org/
r1s2g3
Sr. Member
****
Offline Offline

Activity: 742
Merit: 395


I am alive but in hibernation.


View Profile
June 04, 2018, 02:09:50 AM
 #3

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 Offline

Activity: 168
Merit: 3

#Please, read:Daniel Ellsberg,-The Doomsday *wk


View Profile WWW
June 04, 2018, 03:54:34 AM
 #4

Honestly, I am not a language specialist but I have a slightly preference for languages like ADA.

from my textbook

Quote
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 Offline

Activity: 2069
Merit: 1164


Keeper of the Private Key


View Profile
June 04, 2018, 06:17:44 AM
 #5

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

Bitcoin is not a bubble, it's the pin!
+++ GPG Public key FFBD756C24B54962E6A772EA1C680D74DB714D40 +++ http://pgp.mit.edu/pks/lookup?op=get&search=0x1C680D74DB714D40
ikatamoonshots
Jr. Member
*
Offline Offline

Activity: 44
Merit: 2


View Profile
June 04, 2018, 09:04:47 AM
 #6

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:
Code:
https://www.thegeekstuff.com/2010/07/bash-string-manipulation/ 
You also can automate almost any system task using shell scripts Smiley
May read this
Code:
https://github.com/awesome-lists/awesome-bash

andrew1carlssin
Jr. Member
*
Offline Offline

Activity: 168
Merit: 3

#Please, read:Daniel Ellsberg,-The Doomsday *wk


View Profile WWW
June 04, 2018, 10:04:07 AM
 #7

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:
Code:
https://www.thegeekstuff.com/2010/07/bash-string-manipulation/ 
You also can automate almost any system task using shell scripts Smiley
May read this
Code:
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
Code:
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  Wink

Satoshi's book editor; SCIpher - https://pdos.csail.mit.edu/archive/scigen/scipher.html
ikatamoonshots
Jr. Member
*
Offline Offline

Activity: 44
Merit: 2


View Profile
June 04, 2018, 10:48:38 AM
 #8


Code:
date +%s.%N | sha256sum | base64 | head -c 32 ; echo
 



Smiley

Code:
cat /dev/urandom | tr -dc 'A-Za-z0-9!"#$%&'\''()*+,-./:;<=>?@[\]^_`{|}~' | head -c 28 | sha256sum | base64 | head -c 32 && echo ""
starmyc
Full Member
***
Offline Offline

Activity: 198
Merit: 130

Some random software engineer


View Profile
June 04, 2018, 05:19:04 PM
 #9


Code:
date +%s.%N | sha256sum | base64 | head -c 32 ; echo
 



Smiley

Code:
cat /dev/urandom | tr -dc 'A-Za-z0-9!"#$%&'\''()*+,-./:;<=>?@[\]^_`{|}~' | head -c 28 | sha256sum | base64 | head -c 32 && echo ""

Code:
$ 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.

Hi, I'm just some random software engineer.
You can check my projects: Bitcoin & altcoin balances/addresses listing dumps: https://balances.crypto-nerdz.org/
mi2018 (OP)
Newbie
*
Offline Offline

Activity: 37
Merit: 0


View Profile
June 04, 2018, 08:17:09 PM
 #10

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
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!