All Questions
Tagged with bash command-line
2,198
questions
-2
votes
0
answers
37
views
(SOLVED) 'realpath' works from bash but not in desktop file [duplicate]
I have a CLI program I'd like to call with different parameters from .desktop files. (The command is rtl_acars_ng which monitors certain aeronautical frequencies for messages).
So, executing from the ...
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 ...
0
votes
1
answer
35
views
Extract Variable Name for Unset Script
I have a .env file that contains information, to include environment variables. For example:
# comment
<mini script>
export NAME="John Doe"
export LOCATION="US"
export ...
0
votes
2
answers
77
views
How to change path to the current directory in bash
I'm trying to customize my bash prompt and here's what looks perfect for me:
PS1='\n\[\033[32m\]\h \[\033[33m\]\w\[\033[36m\]`__git_ps1`\[\033[0m\]\n'
I want the current path to start only from ...
0
votes
1
answer
52
views
Is there a way to force a command's argument to read from stdin instead of straight from the command line? [duplicate]
I have a python script I'm running that I don't have the ability to change. Here's how I tried running it:
python my_script.py --username <username> --password -
Just to see if python would ...
3
votes
1
answer
46
views
Why does MySQL print "\\." instead of "\." on the command line?
I just want to select backslash-period "(\.)".
In the MySQL client when I run
mysql> select '\\.';
+----+
| \. |
+----+
That is the outcome I want, but when I create a file name reverse....
0
votes
0
answers
32
views
Error: No Module Named 'example' When Executing a Jupyter Notebook from the Command Line with --ExecutePreprocessor.kernel_name
I am creating a bash command that will allow me to execute a jupyter notebook from the command line. Regardless of which import library I reference first, I get the error "No Module Named '...
0
votes
1
answer
38
views
Why does command substitution work in these ways?
In my .bashrc file I have the following:
export USER_HOME1='/home/$(id -nu)/'
export USER_HOME2='/home/'$(id -nu)'/'
export USER_HOME3="/home/$(id -nu)/"
export USER_HOME4="/home/\$(id ...
0
votes
1
answer
30
views
Copy values from XML element to create a new element with combined new value
I have this XML with multiple products and I want to add a new element with the values of other elements. I want to add a new element to each titled . This should include the values of ProductOption, ...
0
votes
0
answers
23
views
How to print the 1st line of a command’s output to screen, then sort the rest on col 6 and print that to screen? [duplicate]
Using the Linux command line, I would like to:
— print the first line (from a command’s output) to screen
— then sort the rest of the output by column 6, and print that to the screen too
I’m sure ...
1
vote
2
answers
97
views
Map custom and arbitrary functions with sed or awk
I'm trying to use commands sed or awk, together with arbitrary functions (or commands) defined, for example, as Bash scripts. For example, the following Bash script prepend_largest_prime.sh accepts a ...
-2
votes
2
answers
78
views
How to bring a job to foreground and then disable job control in bash? [closed]
I have a program running in a terminal window. I wish to disable the Ctrl+Z shortcut from suspending the process.
After pressing Ctrl+Z, the command fg && set +m unfortunately disables job ...
-1
votes
3
answers
38
views
reformat short per-line data into a(n indexed) tabular layout to fill my terminal
I have a text file containing a small piece of data on each line: Maybe it's a word, or a single number. For simplicity let's assume there are no empty lines and no headers within that file. For ...
0
votes
2
answers
79
views
How to glob all files with an extension in a directory and its subdirectories?
This feels like it must have an obvious answer, but I haven't yet found one.
Consider this file structure:
A.tsx
B.tsx
dist/C.tsx
dist/D.tsx
src/E.tsx
src/F.tsx
src/G.js
src/component/H.tsx
src/...
0
votes
1
answer
89
views
Renaming file extension after uploading to a remote server in WinSCP in batch file
I have a script that uploads files to a remote server using WinSCP. The files are processed and deleted by the receiver on the remote server. I would like to upload only new files being written to the ...