mirror of
https://github.com/gwebu-team/profile.d.git
synced 2025-12-13 12:25:45 +00:00
Let's be MacOS compatible.
This commit is contained in:
parent
3f8ffe86c9
commit
487eb012d0
3 changed files with 14 additions and 5 deletions
|
|
@ -6,8 +6,14 @@ fi
|
|||
# show hidden files and directories
|
||||
alias l.='ls -d .[^.]* ..?* --color=tty 2>/dev/null'
|
||||
|
||||
# long format with ISO dates
|
||||
alias lll='ls -Al "--time-style=+%Y-%m-%d %H:%M:%S %4Z"'
|
||||
if ! which ll 2>/dev/null; then
|
||||
alias ll='ls -l --color=auto'
|
||||
fi
|
||||
|
||||
if [[ "$OSTYPE" != darwin* ]]; then
|
||||
# long format with ISO dates
|
||||
alias lll='ls -Al "--time-style=+%Y-%m-%d %H:%M:%S %4Z"'
|
||||
fi
|
||||
|
||||
# color less (restricted)
|
||||
alias less='less -R'
|
||||
|
|
|
|||
|
|
@ -52,7 +52,7 @@ if [ "$PS1" ] ; then # interactive shell detection
|
|||
# Log the logout event.
|
||||
function prompt_command_exit() {
|
||||
trap - EXIT
|
||||
local now=$(date --rfc-3339=ns)
|
||||
local now=$(date --rfc-3339=ns 2> /dev/null || date -Iseconds)
|
||||
local HistFile
|
||||
HistFile="$HOME/bash_history/$(date '+%Y-%m/%Y-%m-%d')"
|
||||
mkdir -p "${HistFile%/*}"
|
||||
|
|
@ -61,7 +61,7 @@ function prompt_command_exit() {
|
|||
|
||||
# Executed before each prompt. Fill the variables needed by PS1 here.
|
||||
function prompt_command() {
|
||||
local now=$(date --rfc-3339=ns)
|
||||
local now=$(date --rfc-3339=ns 2> /dev/null || date -Iseconds)
|
||||
|
||||
# Manage the history
|
||||
local HistFile="$HOME/bash_history/$(date '+%Y-%m/%Y-%m-%d')"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue