Grep for a string that ends with specific character?

Is there a way to use extended regular expressions to find a specific pattern that ends with a string. I mean, I wa...

How to convert a string to lower case in Bash??

Is there a way in bash to convert a string into a lower case string? For example, if I have: a="Hi all" I want t...

How to find file accessed/created just few minutes ago?

I always forget which file I edit one minutes ago, so I input find . -cmin 1 or some other value but it worked exact...

How to return an array in bash without using globals??

I have a function that creates an array and I want to return the array to the caller: create_array() { local my_l...

bash/fish command to print absolute path to a file?

Question: is there a simple sh/bash/zsh/fish/... command to print the absolute path of whichever file I feed it? Us...

How to get the source directory of a Bash script from within the script itself??

How do I get the path of the directory in which a Bash script is located, inside that script? I want to use a Bash ...

Linux sh script throws “#!/bin/sh: not found”?

i have a script #!/bin/sh # Automatically remove a torrent and delete its data after a specified period of # time ...

How to extract the filename without the extension from a full path??

I'm trying to right my first bash script, and at one point a filename is passed to the script as $1. I need to extra...

What is the maximum value of a numeric bash shell variable??

I'm curious as to what happens when a numeric variable in bash is incremented up without purposely stopping it. How ...

Renaming a session?

In bash I can start a named screen by doing screen -S test If I type ctrl-a A new_screen_name it only change...

BASH script - execute command in variable?

I am doing a bash script to backup my database daily(on Mac OS X) and I want to save the newest 7 backup directories...

How to right-click to paste in mcedit?

On a bash terminal I can right-click to paste to vim or nano, but mcedit does not receive my clipboard data on right...

“command not found” when running a shell script. What did I break??

I'm on OSX Snow Leopard. Here's the full contents of grr.sh: #!/bin/sh echo wow When I try to run it from termi...

I'm getting a bash: syntax error near unexpected token '('?

I'm working on saving high scores for my Game Elf JAMMA board (412-in-1). I'm currently following this tutorial. I'm...

Check if any of the parameters to a bash script match a string?

I'm trying to write a script where I want to check if any of the parameters passed to a bash script match a string. ...