Tag: sh

61 votes
20 answers
3.1K views
Loop through an array of strings in Bash?

I want to write a script that loops through 15 strings (array possibly?) Is that possible? Something like: f

avatar
Venice
0 1 0 9
asked 07 September, 2021
55 votes
30 answers
851 views
How can I count all the lines of code in a directory recursively?

We've got a PHP application and want to count all the lines of code under a specific directory and its su

avatar
Deedee
0 1 0 9
asked 07 September, 2021
58 votes
20 answers
1.7K views
How do I iterate over a range of numbers defined by variables in Bash?

How do I iterate over a range of numbers in Bash when the range is given by a variable? I know I can do this

avatar
Benton
0 1 0 9
asked 07 September, 2021
58 votes
16 answers
1K views
How to reload .bashrc settings without logging out and back in again?

If I make changes to .bashrc, how do I reload it without logging out and back in?

avatar
Freida
0 1 0 9
asked 07 September, 2021
58 votes
30 answers
2.5K views
How to check if a variable is set in Bash?

How do I know if a variable is set in Bash? For example, how do I check if the user gave the first parameter

avatar
Basil
0 1 0 9
asked 07 September, 2021
59 votes
14 answers
1.1K views
How do I set a variable to the output of a command in Bash?

I have a pretty simple script that is something like the following: #!/bin/bash VAR1="$1" MOREF='sudo r

avatar
Elicia
0 1 0 9
asked 07 September, 2021
53 votes
19 answers
1.4K views
How to delete from a text file, all lines that contain a specific string?

How would I use sed to delete all lines in a text file that contain a specific string?

avatar
Fabian
0 1 0 9
asked 07 September, 2021
56 votes
18 answers
2.4K views
How can I recursively find all files in current and subfolders based on wildcard matching?

How can I recursively find all files in current and subfolders based on wildcard matching?

avatar
Robt
0 1 0 9
asked 07 September, 2021
47 votes
16 answers
1.6K views
How to mkdir only if a directory does not already exist?

I am writing a shell script to run under the KornShell (ksh) on AIX. I would like to use the mkdir command to

avatar
Yolando
0 1 0 9
asked 07 September, 2021
48 votes
30 answers
1.1K views
How do I split a string on a delimiter in Bash?

I have this string stored in a variable: IN="[email protected];[email protected]" Now I would like to split the stri

avatar
Lynette
0 1 0 9
asked 07 September, 2021
62 votes
18 answers
399 views
In the shell, what does " 2>&1 " mean?

In a Unix shell, if I want to combine stderr and stdout into the stdout stream for further manipulation, I can

avatar
Renaldo
0 1 0 9
asked 07 September, 2021
52 votes
12 answers
1.3K views
How do I copy a folder from remote to local using scp?

How do I copy a folder from remote to local host using scp? I use ssh to log in my server. Then, I would like

avatar
Scot
0 1 0 9
asked 07 September, 2021
51 votes
26 answers
2K views
How to check if a string contains a substring in Bash

I have a string in Bash: string="My string" How can I test if it contains another string? if [ $string ?? &ap

avatar
Sena
0 1 0 9
asked 07 September, 2021
51 votes
30 answers
1.5K views
How to concatenate string variables in Bash

In PHP, strings are concatenated together as follows: $foo = "Hello"; $foo .= " World"; Here, $foo becomes

avatar
Luis
0 1 0 9
asked 07 September, 2021
59 votes
30 answers
1.6K views
How can I check if a directory exists in a Bash shell script?

What command can be used to check if a directory exists or not, within a Bash shell script?

avatar
Louetta
0 1 0 9
asked 07 September, 2021
53 votes
1 answers
899 views
Is it possible to skip some translation when using joomfish?

I'm using Joomla 1.5.26 with Joom!Fish 2.1.7. Does any Joom!Fish and/or joomla guru know if it is possib

avatar
Jesenia
0 1 0 9
asked 07 September, 2021
61 votes
10 answers
513 views
Notification Icon with the new Firebase Cloud Messaging system

Yesterday Google presented at Google I/O the new notification system based on the new Firebase. I tried this n

avatar
Adolfo
0 1 0 9
asked 07 September, 2021
65 votes
3 answers
1.3K views
Is it possible to change a user's Drupal password with Drush?

Is it possible to change a user's Drupal password from the command-line with Drush?

avatar
Royal
0 1 0 9
asked 07 September, 2021
54 votes
20 answers
1.8K views
How to make layout with rounded corners..?

How can I make a layout with rounded corners? I want to apply rounded corners to my LinearLayout.

avatar
Trudy
0 1 0 9
asked 07 September, 2021
60 votes
8 answers
653 views
LINQ: Not Any vs All Don't

Often I want to check if a provided value matches one in a list (e.g. when validating): if (!acceptedValues.A

avatar
Don
0 1 0 9
asked 07 September, 2021