Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mdashraful305/vscode-shell-task-runner
This project contains a VSCode tasks.json configuration that enables you to easily compile and run a shell script with an input file and save the output to an output file.
https://github.com/mdashraful305/vscode-shell-task-runner
bash bash-script linux shell vscode vscode-settings
Last synced: 1 day ago
JSON representation
This project contains a VSCode tasks.json configuration that enables you to easily compile and run a shell script with an input file and save the output to an output file.
- Host: GitHub
- URL: https://github.com/mdashraful305/vscode-shell-task-runner
- Owner: mdashraful305
- License: mit
- Created: 2024-11-07T13:05:47.000Z (about 2 months ago)
- Default Branch: main
- Last Pushed: 2024-11-07T13:12:21.000Z (about 2 months ago)
- Last Synced: 2024-11-07T14:22:58.005Z (about 2 months ago)
- Topics: bash, bash-script, linux, shell, vscode, vscode-settings
- Homepage:
- Size: 3.91 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# VSCode Task for Compiling and Running a Bash Script
This project contains a VSCode `tasks.json` configuration that enables you to easily compile and run a shell script with an input file and save the output to an output file. This setup is useful for automating tasks where an input file is required, and results are stored in a designated output file.
## Prerequisites
- VSCode installed
- Shell access on your system
- `input.txt` file created in your workspace## How It Works
The task in `tasks.json`:
1. Grants execute permissions to the selected file.
2. Executes the file with input redirection from `input.txt` and output redirection to `output.txt`.### Steps to Use
1. Clone this repository to your local environment.
2. Open the project in VSCode.
3. Ensure you have an `input.txt` file in the root of your workspace.
4. Press `Ctrl+Shift+B` to trigger the "Compile and run" task.The task will silently compile and run the current file, using `input.txt` as input and saving the results in `output.txt`.
### Notes
- Modify `input.txt` to change the input parameters.
- View `output.txt` after running the task to check the results.
- Customize the task by editing the `tasks.json` file.## File Structure
```plaintext
├── dir1
│ ├── file11.sh
│ └── file12.sh
├── dir2
│ ├── file21.sh
│ ├── file22.sh
│ └── file23.sh
├── dir3
├── input.txt
└── output.txt
```
## LicenseThis project is licensed under the MIT License - see the LICENSE file for details.