Answers for "Bash"

7

$@ bash

file:test.sh
#! /bin/sh
echo '$#' $#
echo '$@' $@
echo '$?' $?

*If you run the above script as*

> ./test.sh 1 2 3

You get output:
$#  3
$@  1 2 3
$?  0

*You passed 3 parameters to your script.*

$# = number of arguments. Answer is 3
$@ = what parameters were passed. Answer is 1 2 3
$? = was last command successful. Answer is 0 which means 'yes'
Posted by: Guest on April-21-2020
4

Shell/BAsh

# GNU Bash or simply Bash is a Unix shell and command language written
# by Brian Fox for the GNU Project as a free software replacement for 
# the Bourne shell.
Posted by: Guest on June-22-2020
0

shell/bash

#!/bin/bash

#your code
Posted by: Guest on January-15-2021
0

bash

echo # print something in the terminal
sudo # Run a command as an administator
set # Environment variables
export # Make an environment variable
login #login (arch linux)
rm # Remove a file
rmdir # Remove an empty directory
apt # apt package manager (Debian and Debian-based systems only)
Posted by: Guest on September-15-2021
0

Bash

git commit && git push
git commit || echo "Commit failed"
Posted by: Guest on March-30-2021
0

bash

grep " jane " ../data/list.txt | cut -d ' ' -f 1
content_copy
Posted by: Guest on June-01-2021

Browse Popular Code Answers by Language