Skip to main content
deleted 366 characters in body
Source Link

I'm having trouble with my bash script.

My script lists all files ending with .txt inThe selection should be based on submitting an argument when the folder where my script is. Can I for example have

ls -l

as one argument and make

| grep .txt > files_in_folder

as a second argument and then string them together? If so, how?

I really can't figure this out myself and I am probably the biggest noob ever existed :D. It's part of an assignment my beginners course in IT-development executed.

#!/bin/bash

#This script echoes a text and creates a file

echo "welcome. Will create a file with content in this folder"

ls -l | grep .txt > files_in_folder

I'm having trouble with my bash script.

My script lists all files ending with .txt in the folder where my script is. Can I for example have

ls -l

as one argument and make

| grep .txt > files_in_folder

as a second argument and then string them together? If so, how?

I really can't figure this out myself and I am probably the biggest noob ever existed :D. It's part of an assignment my beginners course in IT-development.

#!/bin/bash

#This script echoes a text and creates a file

echo "welcome. Will create a file with content in this folder"

ls -l | grep .txt > files_in_folder

The selection should be based on submitting an argument when the script is executed.

#!/bin/bash

#This script echoes a text and creates a file

echo "welcome. Will create a file with content in this folder"

ls -l | grep .txt > files_in_folder
added 10 characters in body
Source Link
GMaster
  • 6.9k
  • 3
  • 34
  • 35

I'm having trouble with my bash script.

My script lists all files ending with .txt in the folder where my script is. Can I for example have   

ls -l 

as one argument and make

| grep .txt > files_in_folder

as a second argument and then string them together? If so, how?

I really can't figure this out myself and I am probably the biggest noob ever existed :D. It's part of an assignment my beginners course in IT-development.

#!/bin/bash

#This script echoes a text and creates a file

echo "welcome. Will create a file with content in this folder"

ls -l | grep .txt > files_in_folder

I'm having trouble with my bash script.

My script lists all files ending with .txt in the folder where my script is. Can I for example have  ls -l as one argument and make

| grep .txt > files_in_folder

as a second argument and then string them together? If so, how?

I really can't figure this out myself and I am probably the biggest noob ever existed :D. It's part of an assignment my beginners course in IT-development.

#!/bin/bash

#This script echoes a text and creates a file

echo "welcome. Will create a file with content in this folder"

ls -l | grep .txt > files_in_folder

I'm having trouble with my bash script.

My script lists all files ending with .txt in the folder where my script is. Can I for example have 

ls -l 

as one argument and make

| grep .txt > files_in_folder

as a second argument and then string them together? If so, how?

I really can't figure this out myself and I am probably the biggest noob ever existed :D. It's part of an assignment my beginners course in IT-development.

#!/bin/bash

#This script echoes a text and creates a file

echo "welcome. Will create a file with content in this folder"

ls -l | grep .txt > files_in_folder
Formatting
Source Link
AdminBee
  • 23.6k
  • 25
  • 56
  • 77

I'm having trouble with my bash script. 

My script lists all files ending with .txt.txt in the folder where my script is. Can I for example have "ls -l"ls -l as one argument and make "| grep .txt > files_in_folder"

| grep .txt > files_in_folder

as a second argument and then string them together? If so, how? 

I really can't figure this out myself and I am probably the biggest noob ever existed :D. It's part of an assignment my beginners course in IT-development.

#!/bin/bash

#This script echoes a text and creates a file

echo "welcome. Will create a file with content in this folder"

ls -l | grep .txt > files_in_folder

#!/bin/bash

#This script echoes a text and creates a file

echo "welcome. Will create a file with content in this folder"

ls -l | grep .txt > files_in_folder

I'm having trouble with my bash script. My script lists all files ending with .txt in the folder where my script is. Can I for example have "ls -l" as one argument and make "| grep .txt > files_in_folder" as a second argument and then string them together? If so, how? I really can't figure this out myself and I am probably the biggest noob ever existed :D. It's part of an assignment my beginners course in IT-development.

#!/bin/bash

#This script echoes a text and creates a file

echo "welcome. Will create a file with content in this folder"

ls -l | grep .txt > files_in_folder

I'm having trouble with my bash script. 

My script lists all files ending with .txt in the folder where my script is. Can I for example have ls -l as one argument and make

| grep .txt > files_in_folder

as a second argument and then string them together? If so, how? 

I really can't figure this out myself and I am probably the biggest noob ever existed :D. It's part of an assignment my beginners course in IT-development.

#!/bin/bash

#This script echoes a text and creates a file

echo "welcome. Will create a file with content in this folder"

ls -l | grep .txt > files_in_folder
Source Link
Loading