If I wanted to make a directory and change directory into it all in one line, I could do something like this: mkdir dir_name && cd $_ How can I do the
Why do I receive a syntax error for the following one-liner Python code? python -c 'import re; if True: print "HELLO";' File "<string>", line 1 impo
I'm writing a bash script and it throws an error when using "sh" command in Ubuntu (it seems it's not compatible with dash, I'm learning on this subject). So I
The MRE below should be enough to explain what I'm trying to do. Google doesn't help as it seems to be a unique error, which surprised me since Alpine & PyT
I'm practicing bash and honestly, it is pretty fun. However, I'm trying to write a program that compares an array's value to a variable and if they are the same
I'm practicing bash and honestly, it is pretty fun. However, I'm trying to write a program that compares an array's value to a variable and if they are the same
I have a sample sh script on my Linux environment, which basically run's the ssh-agent for the current shell, adds a key to it and runs two git commands: #!/bi
I'm writing my PROMPT_COMMAND="history -a;$PROMPT_COMMAND" but I still get some duplicates from different terminal sessions. It seems I still will get some dupl
How can i split my long string constant over multiple lines? I realize that you can do this: echo "continuation \ lines" >continuation lines However, if you
I want to do something like this on commandline on my UNIX variant if (shasum httpd-2.4.7.tar.bz2 == 19asdasdasd56462e44d61a093ea57e964cf0af05c0e) echo 'good t
I have a Bash script that creates a .tar.gz file, encrypts, and then sends it to a drive. However, I cannot open the .tar.gz file afterwards. Here is my process
I know how I can rename files and such, but I'm having trouble with this. I only need to rename test-this in a for loop. test-this.ext test-this.volume001+02.
I'm trying to make a bash script that will send an email to all contacts which will contain a message and an attachment. This is not for malicious purposes. Ho
When writing shell programs, we often use /bin/sh and /bin/bash. I usually use bash, but I don't know what's the difference between them. What's main difference
I have a shell script which shuffles a large text file (6 million rows and 6 columns) sorts the file based the first column outputs 1000 files So the pseu
Assume this: It needs to pass a file name as an argument. This is the only text I’m showing. The remaining text has more data (not shown
I have a external drive that I use on my car and on my TV, I use Mac OS X to manage files, but the hidden files that the Finder and Windows creates is very anno
I have a external drive that I use on my car and on my TV, I use Mac OS X to manage files, but the hidden files that the Finder and Windows creates is very anno
Is there some sort of character limit imposed in bash (or other shells) for how long an input can be? If so, what is that character limit? I.e. Is it possible
I have the following shell script. There is a deploy function, that is used later in the script to deploy containers. function deploy { if [[ $4 -eq QA ]]