Quick way to find if a port is open on Linux

Bash
From a bash script how can I quickly find out whether a port 445 is open/listening on a server. I have tried a couple of options, but I want somethin...
1 year ago

How can I convert tabs to spaces in every file of a directory?

Bash
How can I convert tabs to spaces in every file of a directory (possibly recursively)? Also, is there a way of setting the number of spaces per tab?
1 year ago

Cron job does not run

Bash
Following is the entry in the crontab: MAILTO=abc@gmail.com 45 14 * * * /home/user/simple.sh I've also done chmod +x on the simple.sh But the cront...
1 year ago

How do I use this basic shell script in Mac OS X Terminal?

Bash
I'd like to download videos from Harvard's CS109 course. I found this page that describes the process. I'm on Mac OS X El Capitan and I've successful...
1 year ago

What does !* mean in tcsh shell?

Bash
such as command myCommand !* & & is run in bg, but what is !* ? Can not find it anywhere, c shell is not used anywhere nowadays ... ...
1 year ago

Replace multiple property values with new variables

Bash
I'm doing a little Shell/Bash automation and I have a properties file that I need to update with new values. The property file is of the format: key....
1 year ago

OS X Automator and shell issue

Bash
I'm trying to make an automator workflow on OS X which opens the selected images in the finder and opens it with Photoshop During this, I need to use...
1 year ago

Dynamically-created 'zip' command not excluding directories properly

Bash
I'm the author of a utilty that makes compressing projects using zip a bit easier, especially when you have to compress regularly, such as for updatin...
1 year ago

Shellscript: loop through a JSON array with jq

Bash
I'm using jq library to parse a file into json object and extract data. Following codes give my error: for ((i = 0; i < ${#nvars[@]}; i++)); do ...
1 year ago

Access a variabe referred back twice UNIX

Bash
This is a simple question, but I have the variables classNext1="Exists!" classNext2="Exists!" classNext3="Does not exist yet!" classNext4="Does not e...
1 year ago

bash shell date parsing, start with specifc date and loop through each day in month

Bash
I need to create a bash shell script starting with a day and then loop through each subsequent day formatting that output as %Y_%m_d I figure I can s...
1 year ago

How to check for duplicate files, if duplicates are found then append filenames?

Bash
I am using a find command to find files formatted 'DGT_????.JPG'. I would like to then copy these to another folder. However, the script finds duplica...
1 year ago

Access a variable referred back twice UNIX

Bash
This is a simple question, but I have the variables classNext1="Exists!" classNext2="Exists!" classNext3="Does not exist yet!" classNext4="Does not e...
1 year ago

Execute a statement after logging in to SSH

Bash
I am writing a script in which i have to execute a set of statments after logging in via SSH. So i am using this command ssh -t user@adf-svc-1001.do...
1 year ago

Finding all directories that are world readable

Bash
**I cannot use find as I get a permission denied error I am trying to find all the directories in /students that are world readable. This is what I h...
1 year ago

Regex - script check for allowed characters

Bash
I need to check a string and make sure that it does not contain any character outside list of given characters. I wrote one script to test this: str...
1 year ago

What is the proper way to test if variable is empty in a batch file, If NOT "%1" == "" GOTO SomeLabel, fails if %1 has quotes

Bash
I need to test if a variable is set or not. I've tried several techniques but they seem to fail whenever %1 is surrounded by quotes such as the case ...
1 year ago

Communication between kernel and shell

Bash
I had a query regarding kernels and shells in general. Is it possible for an OS to run multiple shells at the same time or is there just one shell and...
1 year ago

How to submit a SGE job calling my python script

Bash
So, I want to run a python script in a remote machine. However, in the manual of the server, they say this: You need to create this script and sa...
1 year ago

expect set variable in bash context

Bash
Do you know if it is possible to assign and print expect variable in a expect script encapsulate in a bash script. Ok this is not clear I know, let's ...
1 year ago