All Questions
4,121
questions
0
votes
1
answer
56
views
Powershell Cannot find drive. A drive with the name ' C' does not exist
Wrote a PS script that reads a .ini file for certain parameters to copy files from folder_a to folder_b,c ..and so on. I get the dreaded "
Cannot find drive. A drive with the name ' C' does not ...
0
votes
0
answers
16
views
How can I save vimdiff output to a specific path in shell scripting [duplicate]
I have this shell script line to save vimdiff output in html format
vimdiff -c TOhtml -c 'w! diff.html | qa!' $INITIAL_FILE $FINAL_FILE
But this saves the file in the same directory as the shell ...
0
votes
2
answers
47
views
Append output file content in sql select query in where clause as a condition
I have a requirement where there is a select query and I have a spooled output.txt file. I want to use this output in select query to put in where clause condition as shown in below example. Can it be ...
0
votes
0
answers
40
views
Running sudo command in bash script [duplicate]
I have a db server where I am sshing into and I am running the command sudo -u oracle -H bash and I am able to validate that successfully by doing this manually but I am trying to do the same process ...
1
vote
1
answer
78
views
PowerShell script doesn't work as it does in ISE
I've developed a program in ISE, but don't get the same behavior when running it from the command line (e.g., > .\script.ps1 -ProjectDirectoryPath .\project). Namely, exceptions are not redirected ...
-3
votes
0
answers
75
views
One-liner to create and enter a temporary directory? [duplicate]
I am passing a small series of commands to a remote server through ssh. the basic format is:
sshpass -p $password ssh $username@$host -p $port $commands
the commands are passed in the form of a string,...
-1
votes
1
answer
60
views
Unexpected Operator [closed]
Am learning Linux, I tried to execute this script, but am getting the error saying that "-gt: unary operator expected"
num=$5
if [ $num -gt 10 ]
then
echo "greater than 10&...
0
votes
1
answer
61
views
I can't make my shell script detect spaces and hyphens in file names
I'm a hobbyist media collector and I recently started a project of mine, being a self-hosted media server with my owned media. I've been doing everything manually for a while but started getting into ...
0
votes
0
answers
37
views
Can't echo same variable twice on one line [duplicate]
PORT=$(cat /root/EnvironmentConfigurations/mbc_back/.env | grep '^PORT=' | cut -d '=' -f 2)
echo $PORT:$PORT
OUTPUT IS-> ":6590" SHOULD BE-> "6590:6590"
I have tried to ...
0
votes
0
answers
32
views
What is the difference between shell scripting and bash scripting? (novice level answer) [duplicate]
What is the difference between shell scripting and bash scripting? I can't find any explanations at a reasonable level of familiarity to me.
I have read up on past stack overflow posts but they do not ...
0
votes
0
answers
23
views
Writing a bash script to wait for a process on a remote machine to finish [duplicate]
I'm writing a script to automate some tasks, one of the steps is to wait for a process started on a remote machine to finish execution.
My idea is to show a spinner while the process keeps executing, ...
0
votes
4
answers
57
views
How to use the output of a command as another command (nor an argument of one) in a shell script
I need to get a value from a file where it is defined as variable1=value1.
So if I do cat file | grep variable1 I get variable1=value1.
I would like to do this inside a script so that variable1 is ...
2
votes
3
answers
66
views
Bash script (cron job?) to process files uploaded to a directory?
Let's say I have a tool called jpeg2txt. I need to write a bash script that:
Constantly checks if there are any new files (JPEGs) in source directory
Launches jpeg2txt on them, and writes the results ...
0
votes
2
answers
86
views
How to extract just the open port numbers from nmap [closed]
Right now my aim is to scan a single IP and get only the open ports printed in a single line separated by commas.
The code below does that but it injects % at the end.
The goal is to extract port ...
0
votes
1
answer
42
views
How to properly escape/quote the output so it's treated as an escaped input? [duplicate]
I've been trying to create a set of aliases or functions, that I can use in conjunction with file operating commands.
The idea is to have 1, 2, 3 functions/aliases that will return latest, second-to-...