Creating A Simple Bash Script With Multiple Commands

Posted by unorthodox grammar on Ask Ubuntu See other posts from Ask Ubuntu or by unorthodox grammar
Published on 2014-06-01T22:29:05Z Indexed on 2014/06/02 9:51 UTC
Read the original article Hit count: 314

Filed under:

Trying to create a bash script that opens gnome-terminal, and then runs ls to display the contents of a directory, but it just opens gnome-terminal. I will be creating some other scripts that also use multiple commands.

My script:

#!/bin/bash
gnome-terminal
ls -a /examplefolder

EDIT:

To clarify what I'm trying to achieve. I'm trying to create a script that will open gnome-terminal, list the contents of /examplefolder, and then be ready for regular terminal usage. Is this possible, or am I barking up the wrong tree?

© Ask Ubuntu or respective owner

Related posts about bash