Browse Source

shabang

master
Anthony Fadly 1 year ago
parent
commit
a28525c0e1
1 changed files with 17 additions and 0 deletions
  1. 17
    0
      sep26.md

+ 17
- 0
sep26.md View File

@@ -15,3 +15,20 @@ $ ( echo 1 || exit 1 ) && { echo 2 ; echo 3 || exit 7; } && ( exit 5 )
1. `( echo 1 || exit 1 )` exits 0
2. `{ echo 2 ; echo 3 || exit 7; }` exits 0
3. `( exit 5 )` exits 5

## How do you know the type of a file? ShaBang!

Sharp (#) Bang (!) on the first line of the file

`#!/bin/bash` for shell scripts

`#!/usr/bin/python` for python scripts

```
$ ls -l file.bash
-rwxrwxr-x 1 username username datetime file.bash*
```

the first `-` in `-rwxrwxr-x` means it is a file not a directory

r means read, w means write, x means execute

Loading…
Cancel
Save