shell Questions

5

Solved

I am fairly new to running scripts in UNIX/Linux. I have a .env file containing environment information and a .sh script containing folder creations etc for that environment. How would I run the s...
Incompetent asked 11/2, 2016 at 18:45

2

Solved

My json looks like this : { "20160522201409-jobsv1-1": { "vmStateDisplayName": "Ready", "servers": { "20160522201409 jobs_v1 1": { "serverStateDisplayName": "Ready", "creationDate": "2016-0...
Katelyn asked 1/6, 2016 at 19:56

3

I would like to execute the below curl command and specify my own key store. I tried using --cacert option and specified the path of the cacert jks. curl --ssl-reqd --url 'smtp://mailhost.myorg.com...
Mcswain asked 17/12, 2020 at 1:32

3

Solved

sort doesn't seem to like my key specification. Why? ~/tmp $ sort --version sort (GNU coreutils) 8.25 Packaged by Cygwin (8.25-1) ~/tmp $ echo 'a;b;c;d;e;f;g'|sort --field-separator=';' --key=1,5,...
Advocation asked 6/7, 2016 at 10:5

8

awk -F: '{ printf "%-3s %-2s","\n" $1 $2; }' How do i add in color code? '\e[1;32m' I try adding in to printf, it give me output of the string instead of color code.. '\e[1;32m' .......
Gaggle asked 23/1, 2013 at 14:30

5

Solved

Sometimes I need to save the last typed shell command into the clipboard. I can do something like this: echo !! | xsel --clipboard Which works successfully. But when I try to alias the above comma...
Michel asked 17/7, 2014 at 14:41

13

Solved

I am generating a PDF dynamically. How can I check the number of pages in the PDF using a shell script?
Tiebout asked 5/2, 2013 at 9:39

11

Solved

I am trying to capture output from an install script (that uses scp) and log it. However, I am not getting everything that scp is printing out, namely, the progress bar. screen output: Copying...
Soutine asked 14/10, 2008 at 19:8

22

Solved

How do I check the validity of an IP address in a shell script, that is within the range 0.0.0.0 to 255.255.255.255?
Beet asked 8/12, 2012 at 12:18

4

Solved

I want to test the output of a bash script when one of the executables it depends on is missing, so I want to run that script with the dependency "hidden" but no others. PATH= ./script isn't an opt...
Steadfast asked 28/6, 2015 at 11:38

5

Solved

So I'm creating a GitHub Pages site to list all of the Gifs in my jglovier/gifs repo. GH Pages runs only static HTML/CSS/JS or Jekyll, so I cannot use an apache directory listing or any other serve...
Lovelady asked 28/1, 2014 at 1:25

3

When using the ! shortcut to execute shell commands from a Notebook, how can I respond to subsequent prompts? For example: !read varname Seems to hang the kernel indefinitely and I can't run anoth...
Sweatbox asked 7/2, 2019 at 21:12

5

Solved

I'm trying to rename all files in current directory such that upper case name is converted to lower. I'm trying to do it like this: ls -1|gawk '{print "`mv "$0" "tolower($0)"`"}'|xargs -i -t eval ...
Presume asked 11/11, 2010 at 11:53

8

Is there a convention for documenting shell scripts' parameters? For example: #!/usr/bin/env bash # <description> # # Usage: # $ ./myScript param1 [param2] # * param1: <description> ...
Flap asked 26/3, 2009 at 22:21

7

Solved

I'm streaming data using netcat and piping the output to gawk. Here is an example byte sequence that gawk will receive: =AAAA;=BBBB;;CCCC==DDDD; The data includes nearly any arbitrary characters, ...
Turkic asked 3/7, 2024 at 3:57

6

Solved

On one of our remote systems mkdir -p $directory fails when the directory exists. which means it shows mkdir: cannot create directory '$directory' : file exists This is really puzzling, as I ...
Zwinglian asked 24/1, 2013 at 8:30

3

I have a requirement where I am trying to write a shell script which is calling curl command internally. I have the password, username and url stored as variables in the script. However, since I wa...
Aves asked 3/10, 2017 at 8:15

5

A while ago I saved some images generated by a web service so the file names are e.g 'ysauyft87ggsa67fgeg&w=1600'. I can open and manipulate these images OK, I'd just like to know what encoding...
Deadlock asked 27/12, 2014 at 18:11

18

Solved

I am trying to automate mysql_secure_installation script with automated response. My code is as follows : echo "& y y abc abc y y y y" | ./usr/bin/mysql_secure_installation The actual questi...
Damselfly asked 17/6, 2014 at 18:18

4

Solved

So I want to set some paths differently depending on the host, but unfortunately it's not working. Here is my script: if [$HOSTNAME == "foo"]; then echo "success" else echo "failure" fi This i...
Dapsang asked 12/4, 2013 at 13:54

5

Solved

My MongoDB is hosted on compose.io and is called ScroungeBA. I try to create a user with some built-in roles which by the documentary only work in the admin database: MongoDB provides all other...
Breeching asked 7/8, 2015 at 9:19

7

Solved

I have the following scenario: I have an env variable $SOME_IP defined and want to use it in a nginx block. Referring to the nginx documentation I use the env directive in the nginx.conf file like ...
Morena asked 18/2, 2014 at 22:5

8

Solved

I am trying to find a way for grep to output only the content of a capturing group. For instance, if I have the following file: hello1, please match me hello2, please do not match me I would like ...
Killigrew asked 14/10, 2019 at 14:45

4

I have a django app and I am running some unit tests on it. So the problem I am having is not when one test inserts into the test db. It is the tests that come after. Since each test is not saving ...
Defecate asked 24/7, 2018 at 17:7

3

Solved

I'm using ssh command to remotely executing a shell script with -o **StrictHostKeyChecking=no ** option to bypass the authentification: ssh -o StrictHostKeyChecking=no root@$IP '/test-script' Howe...
Fanciful asked 20/10, 2020 at 16:33

© 2022 - 2025 — McMap. All rights reserved.