Linked Questions

1 vote
0 answers
58 views

Is there any reason for doing something like: a="abc" or a='abc' The quotes seem completely superfluous, but then there might be some hideous corner case... I'm interested in Bash and Sh in ...
user avatar
1 vote
0 answers
39 views

I always do this when passing variable to command mkdir -p "$dir_to_make" are those quotes needed? I tried to google but didn't find much. I always write them, just interested if they are necessary.
graywolf's user avatar
  • 971
0 votes
1 answer
48 views

I'm confronted with an escape challenge: The process: Step 1 - the file retrieval: Within bash, find command will be invoked. Find commands output is 1 single file with a path like this: ./vacation/...
user avatar
0 votes
0 answers
37 views

I have a file like this /* Created by Bla bla bla Copyright by XYZ December 20th, 2020 */ "car" = "Carro"; "door" = "Porta"; I would like to read ...
Duck's user avatar
  • 4,814
0 votes
0 answers
43 views

I have written a Bash script which doesn't behave quite as I expected. It contains the following lines of code. TARGET_FOLDER=$1 echo "TARGET_FOLDER: $TARGET_FOLDER" if [ ! -d $TARGET_FOLDER ...
user3728501's user avatar
0 votes
0 answers
32 views

I have an awk command piped to the output of another command | awk {'print $2,$3'}. When I run this command the output displays the data in columns, of the columns as I would expect column2 column3 a ...
mcv110's user avatar
  • 23
0 votes
0 answers
28 views

I'm trying to search my Movies folder to find the immediate folder of the .MKV file I'm searching for. The below works (echo 5) to save the immediate folder as a variable, BUT, it does not work if $...
eptesicus's user avatar
0 votes
1 answer
45 views

I know the typical way is echo "$PATH", for example. But echo $PATH also works. Also, you don't need the echo command even, you can just type $PATH, and the value of path will be outputted ...
vw1262's user avatar
  • 19
0 votes
0 answers
26 views

I am using Gammu for receiving SMS. Once received I am sending them as emails. Yet if sender ID of the SMS contains space, my script is unable to process a file. I.e.: If the file name is ...
ŁukaszI's user avatar
0 votes
0 answers
25 views

Inside [[ ]] I do not need to quote variables right? Rather than if [[ "$flrm" == *"org"* || "$flrm" == "all" ]]; then printf '%s\n' "Delete: $fl" ...
Vera's user avatar
  • 1,373
0 votes
0 answers
19 views

I'm a linux noob. When I type echo $(cal) in bash it prints calendar without any formatting. But when i type echo "$(cal)" it prints the complete formatted calendar. What is the distinction ...
meeso2004's user avatar
0 votes
0 answers
17 views

I am working on a self project which is an API server. I am trying to test my api routes using curl command with bash scripts. The curl commands for post requests are pretty long so I want to use a ...
Chirag Kadam's user avatar
0 votes
0 answers
15 views

In zsh: % RESPONSE=$(ping -c 1 raspberrypi4b.local) % echo $RESPONSE | grep "% packet loss" 1 packets transmitted, 1 packets received, 0.0% packet loss But in bash it's different: $ RESPONSE=$(...
Seamus's user avatar
  • 3,898
1412 votes
12 answers
3.7m views

I'm wondering where a new path has to be added to the PATH environment variable. I know this can be accomplished by editing .bashrc (for example), but it's not clear how to do this. This way: export ...
Paolo's user avatar
  • 17.9k
320 votes
12 answers
588k views

The following bash syntax verifies if param isn't empty: [[ ! -z $param ]] For example: param="" [[ ! -z $param ]] && echo "I am not zero" No output and its fine. But when param is ...
maihabunash's user avatar
  • 7,231

15 30 50 per page
1 2
3
4 5
23