All Questions
10,256
questions
-1
votes
0
answers
12
views
character like '\' coming in SQL output while assigning the output to a variable in shell script [duplicate]
I am trying to run a SQL query in shell script and assigning its output to a variable.
When I run the script in Putty in the output variable character like \ is coming in data.
But when I run the same ...
-3
votes
1
answer
121
views
How to interface with a UNIX port? [closed]
I have encountered this same question in numerous forms over the past year, and have not been able to find the solution I am after. As the question has yet again reared its head, I am asking here with ...
0
votes
1
answer
40
views
How to make nohup release prompt?
The script below never prints done unless you manually hit the enter key. The dev machine is osx, the server ubuntu 22.04.
It's a script to restart the remote web server. Web server uses bun.js ...
2
votes
5
answers
85
views
How to insert a character in front of a line one line above a specific character?
In my text file there are many lines whose contents are almost the same. Here are some of them.
So, what I want is to overwrite the / with - on every line and then insert - in front of the line ...
1
vote
1
answer
68
views
Multiprocessing in bash [duplicate]
I wrote a script (wrapper) over one python project.
here are the links:
https://github.com/daniellerch/aletheia
https://daniellerch.me/stego/aletheia/intro-en/#aletheia-commands
The essence of the ...
0
votes
1
answer
50
views
Why is forked child killed by (former) parent process exiting [duplicate]
I am trying to write a very minimalist version of the idea of "window swallowing" that can work with Xterm, or any terminal emulator that provides the -e option to run a specified program as ...
0
votes
1
answer
72
views
how can i tail the last line of multiple log files, only if they have not completed yet?
I have multiple subdirectories, and each has a log file that I want to check, but I only want to check the log files that have not reached the "completed" state. The last line of a completed ...
-2
votes
2
answers
48
views
Shell Bash Comparing expr result of IF [duplicate]
I am learning shell bash now, and tried to figure it out how to compare expr result on IF condition.
Basically want to return only odd natural numbers
The code
a=1
while [ $a -lt 10 ]
do
echo &...
2
votes
3
answers
92
views
how i can print or sum one larger hex in bash
when i use
printf "%064X\n" $((0x1a838b13505b26867))
the number one was truncated
000000000000000000000000000000000000000000000000A838B13505B26867
with big hex/number is worse
printf "...
1
vote
3
answers
121
views
Iterating and saving files with new headers and names in bash
I'm trying to iterate over some subdirectory files, save the unique directory names to a string called "basename", then print the first and fourth columns to a new file that uses that ...
0
votes
3
answers
143
views
How do I exit from nested shells at the command line without accidentally closing/exiting my terminal?
If I am typing in a terminal and do this
% bash
% [enter many commands in this shell]
% bash
% [enter many commands in this shell]
. . .
(could be zsh instead of bash) and I forget how many shells ...
0
votes
1
answer
56
views
bash script - check number of input arguments based on one input argument value
I have to create a bash script for which i need to give input arguments based on action type: insert/update.
In case of insert the bash script will need 3 input arguments but in case of update are ...
-1
votes
1
answer
57
views
Problem while implementing a function in a conditional bash command using background operator (&)
I'm working on a Bash script where I need to show a spinner animation function while checking if a specified Git remote exists. The script snippet for checking the Git remote is as follows:
read ...
-1
votes
1
answer
63
views
how to print block like characters in unix
How can I make "▒" in unix shell script like this -->
0
votes
1
answer
66
views
How can extract data single line from file and other process in each that line? [closed]
i have log file with contents inside. i.e file name is convert.20231010.log.
The content inside file as below
2024-05-17 00:14:02.447 Success ABCXYZ15 on hard disk
2024-05-17 00:14:02.447 Fail at /...