Scripting - 14paxton/Linux GitHub Wiki
title: Scripting permalink: Linux/Scripting category: Linux parent: Linux layout: default has_children: false share: true shortRepo:
- linux
- default
Table of contents
{: .text-delta } 1. TOC {:toc}
$0
$1
-$9
$#
$@
$?
$$
$USER
$HOSTNAME
$SECONDS
$RANDOM
$LINENO
$1, $2, ...
variable=value
Quotes " '
variable=$( command )
export var1
export GH_TOKEN=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;
act=$(gh auth status -t >>(tee -a) 2>&1 | sed -n 's/.*Token: //p');
if [[ "$act" == *"$GH_TOKEN"* ]]
then echo $GH_TOKEN | gh auth login --with-token;
tee
can be used to create a file from output
here i take the out put pipe that and error output
2 >&1
File descriptor 1
is the standard output (stdout)
File descriptor 2
is the standard error (stderr)
2>
redirects stderr to an (unspecified) file.
&1
redirectsstderr
tostdout