Skip to main content

Questions tagged [assignment]

0 votes
1 answer
75 views

Can anyone explain what's going on with DR here? user@host:~# DRYRUN=true user@host:~# echo "$DRYRUN" true user@host:~# $DRYRUN && export DR="-n" user@host:~# echo $DR user@...
Hugh's user avatar
  • 19
-3 votes
1 answer
103 views

In the Bash manual, it is written about the tilde expansion: Each variable assignment is checked for unquoted tilde-prefixes immediately following a ‘:’ or the first ‘=’. Read the Bash manual about ...
Kiki Miki's user avatar
0 votes
2 answers
190 views

The problem is as follows (Here I don't use find since it doesn't support double-asterisk wildcard **): $ FILES=(foo/**/*.suffix bar/**/*.suffix2) $ grep baz "${FILES[@]}" # works # I use ...
An5Drama's user avatar
  • 173
-1 votes
1 answer
508 views

How to have Zsh string variable containing multi words separated by space be assigned to an array so that each word is the array element s='run help behind me' a=($s) m=${a[0]} n=${a[1]} print "m=...
user avatar
1 vote
1 answer
151 views

I need to parse through a directory that contains files and subdirectories however I am unable to use the find command. The for loop is supposed to go through each file and compare it to another ...
IMPNick's user avatar
  • 11
9 votes
2 answers
845 views

Are x=$y and x="$y" always equivalent? Didn't know how to search for this. So far, I've always been using x="$y" to be "on the safe side". But I used x=$1 at one point ...
finefoot's user avatar
  • 3,586
-1 votes
1 answer
74 views

I know the existence of while-do-done. Alternatively, I know that I can use for-do-done. But, I was trying to test manually using if-then-else. I would to like to execute a command, but doing a shift ...
joseluisbz's user avatar
0 votes
1 answer
745 views

After iterating thru the shell arguments and filtering out unwanted arguments into an array, I want to assign the array back to $*. For example, in the below script, I want to remove the arguments -f ...
user3118280's user avatar
1 vote
0 answers
1k views

I am using RHEL 7.9. This version of RHEL I use nmcli and nmtui to configure network connections. Problem: NetworkManager service appears to be filling up journalctl logs with the following output Apr ...
Dave's user avatar
  • 732
7 votes
2 answers
637 views

The second line of the script only works if I trigger glob expansion by executing echo. I can't understand why. Here's the command and it's execution to give some context. Function definition: ~/ cat ~...
bryan hunt's user avatar
0 votes
2 answers
2k views

The question is "Your current directory is cambridge. Move to your home directory using a relative pathname (don't use cd by itself for this move)" but I cannot for the life of me figure it ...
AASFLC's user avatar
  • 3
0 votes
0 answers
121 views

I'm not a BASH programmer and whenever I have to create scripts it's a lottery for me, so apologies if my script looks too redudant or written by a newbie. As a foreword I have many screen snapshots ...
Alex's user avatar
  • 21
0 votes
1 answer
800 views

In bash programming I've always defined conditional variables in the following long hand way dog=1 if [[ $dog -eq 1 ]] ; then cow=1 else cow=0 fi This is obviously incredibly inefficient. In ...
Leo Simon's user avatar
  • 453
8 votes
2 answers
5k views

I know that the SHELL allows variable assignment to take place immediately before a command, such that IFS=":" read a b c d <<< "$here_string" works... What I was ...
computronium's user avatar
1 vote
1 answer
1k views

I am pretty unexperienced (to put it mildly) when it comes to BASH and Shell scripting, so bear with me: $ toda=$(date) | echo $toda gives me: Fr 29 Mai 2020 15:25:19 CEST. So far so good. datediff ...
Guebert's user avatar
  • 13

15 30 50 per page