#!/usr/bin/env bash | |
var=( {0..9} ); #var=( $({0..$[RANDOM%+9]}) ); | |
printf "Set: {$(var2=$(printf ", %s" "${var[@]}") && var2=${var2:2} && printf "${var2}\n";)}"'\n'"Pairs: "'\n'; | |
for (( i = 0; i < ${#var[@]}; i++ )); | |
do | |
for (( j = i + 1; j < ${#var[@]}; j++ )); | |
do | |
# printf "(${i}, ${j}): "'%d\n'; #printf "(${!var[${i}]}, ${!var[${j}]}): "'%d\n'; # array element nummbers |
#!/usr/bin/env bash | |
if [ -d "${symbolic_link_or_directory}" ]; # If symbolic_link_or_directory exists... | |
then | |
if [ -L "${symbolic_link_or_directory}" ]; # If symbolic_link_or_directory is a symbolic link... | |
then | |
rm "${symbolic_link_or_directory}"; # Remove symbolic_link_or_directory. | |
else # Else, i.e. if symbolic_link_or_directory is a directory... | |
if [ $(ls -A "${symbolic_link_or_directory}") ]; # If symbolic_link_or_directory is empty... | |
then |
#!/usr/bin/env bash | |
mkdir directory && cd directory | |
for i in {0..99} | |
do | |
> file${i} | |
printf "make file${i}\n" | |
done #for i in {0..0}{0..9}{0..9}; do > file${i}; echo file${i}; done |
#!/usr/bin/env bash | |
var1=([0]="first" [1]="second" [2]="third" [5]="sixth" [10]="eleventh"); | |
n=([0]="0" [1]="1" [2]="2" [5]="5" [10]="10"); | |
var2=([0]="zero" [1]="one" [2]="two" [5]="five" [10]="ten"); | |
printf '\n`echo \"${var1[@]}\"` s output:\t'; echo "${var1[@]}"; | |
printf '`echo \"${!var1[@]}\"` s output:\t'; echo "${!var1[@]}"; | |
printf '\nWith `${var1[@]}`:\n'; |
#!/usr/bin/env bash | |
osascript -e 'tell application "System Preferences" to quit' # | |
defaults delete com.apple.universalaccess slowKey | |
defaults write com.apple.universalaccess slowKey -bool FALSE # Disable Slow Keys. (i) Required from macOS 10.12 Sierra onwards to set faster key repeat rates. | |
defaults delete com.apple.universalaccess slowKeyDelay | |
#defaults write com.apple.universalaccess slowKeyDelay -int 5 # | |
defaults delete NSGlobalDomain ApplePressAndHoldEnabled |
/* ************************************************************************** */ | |
/* */ | |
/* ::: :::::::: */ | |
/* filename :+: :+: :+: */ | |
/* +:+ +:+ +:+ */ | |
/* By: kbertin <kbertin@student.42.fr> +#+ +:+ +#+ */ | |
/* +#+#+#+#+#+ +#+ */ | |
/* Created: YYYY/MM/DD hh:MM:SS by kbertin #+# #+# */ | |
/* Updated: YYYY/MM/DD hh:MM:SS by kbertin ### ########.fr */ | |
/* */ |
MIT License
Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2020, 2021, 2022 Karl Vincent Pierre Bertin
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN A