Top "Scripting" questions

Scripting is a form of programming generally characterized by low formality, loose typing, and no requirement for explicit compilation.

Test for non-zero length string in Bash: [ -n "$var" ] or [ "$var" ]

I've seen Bash scripts test for a non-zero length string in two different ways. Most scripts use the -n option: #!/…

bash shell if-statement syntax scripting
How do I script a "yes" response for installing programs?

I work with Amazon Linux instances and I have a couple scripts to populate data and install all the programs …

linux bash scripting
How does a Linux/Unix Bash script know its own PID?

I have a script in Bash called Script.sh, and it needs to know its own PID (i.e. I …

bash scripting pid
Global environment variables in a shell script

How to set a global environment variable in a bash script? If I do stuff like #!/bin/bash FOO=bar ...…

shell scripting environment-variables
PowerShell Script to Find and Replace for all Files with a Specific Extension

I have several configuration files on Windows Server 2008 nested like such: C:\Projects\Project_1\project1.config C:\Projects\Project_2\project2.…

powershell scripting replace find
Creating a script for a Telnet session?

Does anyone know of an easy way to create a script that can connect to a telnet server, do some …

scripting telnet
Unix - create path of folders and file

I know you can do mkdir to create a directory and touch to create a file, but is there no …

linux bash shell unix scripting
fork and exec in bash

How do I implement fork and exec in bash? Let us suppose script as echo "Script starts" function_to_fork(){ …

linux bash scripting shell
Loading .sql files from within PHP

I'm creating an installation script for an application that I'm developing and need to create databases dynamically from within PHP. …

php sql mysql import scripting
Copy folder recursively, excluding some folders

I am trying to write a simple bash script that will copy the entire contents of a folder including hidden …

bash unix shell scripting