Issue with activating virtualenv
For me it works when I do these steps: Go to the directory/folder that you want run virtualenv .env then run source .env/bin/activate
For me it works when I do these steps: Go to the directory/folder that you want run virtualenv .env then run source .env/bin/activate
This solution seems to me more intuitive: if [ `ls -1 /var/log/apache2/access.log.* 2>/dev/null | wc -l ` -gt 0 ]; then echo “ok” else echo “ko” fi
This question has been asked in another thread, and this is the best answer IMO: export LOG_FILE_PATH=/expanded/path/of/the/log/file/../logfile.log cat Text_File.msh | envsubst > Text_File_expanded.msh if on Mac, install gettext first: brew install gettext see: Forcing bash to expand variables in a string loaded from a file
You can query the registry API for the image digest and compare it to that of what you’ve pulled. $ cat digest-v2.sh #!/bin/sh ref=”${1:-library/ubuntu:latest}” repo=”${ref%:*}” tag=”${ref##*:}” acceptM=”application/vnd.docker.distribution.manifest.v2+json” acceptML=”application/vnd.docker.distribution.manifest.list.v2+json” token=$(curl -s “https://auth.docker.io/token?service=registry.docker.io&scope=repository:${repo}:pull” \ | jq -r ‘.token’) curl -H “Accept: ${acceptM}” \ -H “Accept: ${acceptML}” \ -H “Authorization: Bearer $token” \ -I -s “https://registry-1.docker.io/v2/${repo}/manifests/${tag}” $ ./digest-v2.sh … Read more
printf‘s %b format specifier was meant specifically to replace echo -e (actually, the XSI extension to echo which calls for special interpretation of the arguments by default. -e was never specified and is disallowed by POSIX.), and is identical in virtually every way including a few differences from $’…’ and the format string argument to … Read more
A simple script I wrote some days ago… # FILE : sctrace.sh # LICENSE : GPL v2.0 (only) # PURPOSE : print the recursive callers’ list for a script # (sort of a process backtrace) # USAGE : [in a script] source sctrace.sh # # TESTED ON : # – Linux, x86 32-bit, Bash 3.2.39(1)-release … Read more
$- prints The current set of options in your current shell. himBH means following options are enabled: H – histexpand: when history expansion is enabled m – monitor: when job control is enabled h – hashall: Locate and remember (hash) commands as they are looked up for execution B – braceexpand: when brace expansion is … Read more
As @kirbyfan64sos notes in a comment, /home is NOT your home directory (a.k.a. home folder): The fact that /home is an absolute, literal path that has no user-specific component provides a clue. While /home happens to be the parent directory of all user-specific home directories on Linux-based systems, you shouldn’t even rely on that, given … Read more
On OSX sed (BSD) sed requires an extension after -i option. Since it is finding -e afterwards it is adding -e to each input filename. btw you don’t even need -e option here. You can pass an empty extension like this: sed -i ” ‘s/foo/bar/g’ $file Or use .bak for an extension to save original … Read more
This is a reasonably common, but not universal, Un*x convention. (It is mentioned in the POSIX specification and so most non-Linux Unices will support it as well.) The important detail here is that the kubectl … -f option expects a filename. If you have a file named x.yaml, a more direct way to write what … Read more