Skip to content

Instantly share code, notes, and snippets.

@akesterson
Created October 22, 2013 11:05
Show Gist options
  • Select an option

  • Save akesterson/7098724 to your computer and use it in GitHub Desktop.

Select an option

Save akesterson/7098724 to your computer and use it in GitHub Desktop.
[akesterson@ec2-54-242-78-15 ~]$ cat test.sh
#!/usr/bin/bash4
function printpid()
{
echo $$
}
echo $$
for i in 1 2 3 4 5;
do
(printpid & )
done
[akesterson@ec2-54-242-78-15 ~]$ bash test.sh
12852
12852
12852
12852
12852
12852
[akesterson@ec2-54-242-78-15 ~]$ bash --version
GNU bash, version 3.2.25(1)-release (x86_64-redhat-linux-gnu)
Copyright (C) 2005 Free Software Foundation, Inc.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment