Top "Sh" questions

sh is the standard Unix shell since Version 7 Unix.

How can I have a newline in a string in sh?

This STR="Hello\nWorld" echo $STR produces as output Hello\nWorld instead of Hello World What should I do to …

sh
Select unique or distinct values from a list in UNIX shell script

I have a ksh script that returns a long list of values, newline separated, and I want to see only …

bash unique distinct ksh sh
Remove redundant paths from $PATH variable

I have defined the same path in the $PATH variable 6 times. I wasn't logging out to check whether it worked. …

linux bash path environment-variables sh
How to extract the first two characters of a string in shell scripting?

For example, given: USCAGoleta9311734.5021-120.1287855805 I want to extract just: US

bash shell grep sh gnu-coreutils
How can I remove the extension of a filename in a shell script?

What's wrong with the following code? name='$filename | cut -f1 -d'.'' As is, I get the literal string $…

bash shell sh cut gnu-coreutils
source command not found in sh shell

I have a script that uses sh shell. I get an error in the line that uses the source command. …

bash shell sh
Get specific line from text file using just shell script

I am trying to get a specific line from a text file. So far, online I have only seen stuff …

linux shell unix sh
I just assigned a variable, but echo $variable shows something else

Here are a series of cases where echo $var can show a different value than what was just assigned. This …

bash shell sh quoting
How to comment out particular lines in a shell script

Can anyone suggest how to comment particular lines in the shell script other than #? Suppose I want to comment five …

shell unix sh
What does $@ mean in a shell script?

What does a dollar sign followed by an at-sign (@) mean in a shell script? For example: umbrella_corp_options $@

linux bash shell unix sh