---
title: "Discussion on \"Shell Script Practical Interview Questions\" | Hashnode"
description: "Discussion on \"Shell Script Practical Interview Questions\". write a shell script to read user input as a string an in output it will reverse the string\n\nAns:\n#!/bin/bash\n\n# Prompt the user to enter a string\nread -p \"Enter a string to reverse: \" input\n\n# Reverse the string and print it\nreversed=$(echo \"$input\"..."
url: "https://hashnode.com/posts/shell-script-practical-interview-questions/66c87156558f8b4f30fa803c"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [Shell Script Practical Interview Questions](https://ashwini23.hashnode.dev/shell-script-practical-interview-questions?utm_source=hashnode&utm_medium=feed)

write a shell script to read user input as a string an in output it will reverse the string Ans: #!/bin/bash # Prompt the user to enter a string read -p "Enter a string to reverse: " input # Reverse the string and print it reversed=$(echo "$input"...

Aug 23, 2024 · 4 min read · ashwini23.hashnode.dev  
Read the article

-   [#shell-script](https://hashnode.com/tag/shell-script)
-   [#linux](https://hashnode.com/tag/linux)
-   [#shellscripting-devops](https://hashnode.com/tag/shellscripting-devops)
-   [#continuous-learning](https://hashnode.com/tag/continuous-learning)
-   [#devops-articles](https://hashnode.com/tag/devops-articles)

## Written by

[ashwini purwat](https://hashnode.com/@Ashwini1008)

@Ashwini1008

  
[View profile](https://hashnode.com/@Ashwini1008)

DevOps Blog

## Responses

Markdown supported · ⌘↵ to post

No responses yet.
