Bash is a free shell for Unix-like operating systems from the GNU Project.

learn more…| top users | synonyms

-1
votes
2answers
22 views

bash + how to capture the requated field from variable

we set the variable with the follwing valuesMY_VAR=" one two three four"how to capture the first value from variable with bash? ( without using echo command ) expected output one
0
votes
0answers
20 views

powershell/cmd suddenly disappears when executing cli programs but they keep on running

I am having issue with my command line. Sometimes when I run some script my powershell/cmd keeps closing/crashing but I know that the program is running because when I open my task manager those ...
0
votes
0answers
12 views

Application mysteriously disappeared

I installed the Storj service on a Lubuntu machine, set it all up, and got it running. I verified that it was running, and even came back a day later to check on it. Then a couple days after that I ...
3
votes
1answer
103 views

printf command wildcard interpretation

I am wondering what behaviour the printf command follows, when using wildcards. This question was originally asked me by someone else, but I am confused by the behaviour myself and would love an ...
1
vote
1answer
19 views

how to use xmllint in order to get value from xml

I have the following XML file<?xml version="1.0" encoding="UTF-8" ?><!-- Component configuration file --><Component><Name>install_env</Name><HelpString>...
0
votes
1answer
23 views

Variable printed the expected value but actually its value is different

The following syntax used in order to capture the word between <Name> in .xml file. I also use xargs to remove any spaces.$> var=` find /tmp -name '*.xml' -exec sed -n 's/<Name>\([^&...
-1
votes
1answer
14 views

sending argument to vim using grep

I saw this question but I couldn't implement what I'm looking for.Here is what I want:I have a file with a few lines ending with 4.1.01.97 (same number for all lines - but number can change from ...
0
votes
1answer
21 views

how to echo text into a file from the CLI to ammend a variable in the file? [duplicate]

using Centos7e.gvi test.txt test.txt contains the following informationx=100y=200z=300I want to put a command into the CLI such as echo x=250 >> test.txt but instead of x=250 being ...
1
vote
1answer
50 views

bash + how to avoid specific messages in the log file

when I run the bash script on my Linux machine we get the following errors in my log , note - we set in the script:exec > $log 2>&1 , ( in order to send all standard error/output to $...
0
votes
1answer
18 views

How to install package from a .tar.lz file

I'm using bash (Cygwin, specifically). I'm trying to install GNU dd_rescue, which comes in a .tar.lz archive file.When I use:tar -xzf ddrescue-1.22.tar.lz...it returns with the following error:...
0
votes
1answer
69 views

mv within shell script does not move files

Often discussed, yet the answers did not get me to a solution unfortunately, and I am a bit ashamed that I need to ask this question again. But, here we are.I have a shell script dosomething.sh with ...
1
vote
0answers
7 views

extend gnome-shell PATH for access to ruby binary with RVM

I have a terminal written in ruby that I install with a gem. I want to be able to launch this terminal when I hit Alt+F2 in gnome-shell. When I used the ruby version of my system, I just have to ...
1
vote
0answers
16 views

Ctrl R not showing latest history

On mac when I try to search my history of commands I get only very old commands. No new command is saved in history. You see here that after history I did a command fdfsdfsd but then if I reopen the ...
0
votes
0answers
10 views

Linux Shell Script to rename a specfic file's extension to .bak in the DST_DIR and copy new file to it from a SRC_DIR [on hold]

I'm getting frustrated trying to figure this out since i'm still a noob at it and under a real time crunch. I'm asking for anyone to help me write a simple .sh script. If I can get this done it will ...
0
votes
0answers
10 views

how to jump straight to php artisan tinker with namespace set using bash alias

I'm an alias freak. I often get asked to edit stuff on prod (hosted on an ec2 instance) using laravel tinker. Manually this would involve doing the following:ssh -i $home/.ssh/key.pub user@...
7
votes
4answers
168 views

How to chain awk print statements?

Okay, here's a quick example; me isolating a host's IPV4 in three steps:ip -br a lo UNKNOWN 127.0.0.1/8 ::1/128 eth0 DOWN wlan0 UP ...
1
vote
3answers
59 views

How do I make a command to refresh itself without writing a .sh script?

I'm doing that command to measure RAM usage:while sleep 1; do free && echo -e && ps -eo rss | awk '{sum+=$1} END {print sum}' && echo -e "\n"; doneHowever, it still keeps ...
-1
votes
1answer
23 views

I have installed ubuntu bash on my windows Xming for GUI purpose [on hold]

How to open browser through terminal? Actually I want to login hasura cluster using Hasura CLI. This CLI is installed in /usr/lib/bin. The command is "hasura login" which will open the browser. But ...
3
votes
2answers
59 views

Achieve better compression for multiple gzipped files

I have several directories containing thousands of gzip files (overall we are talking about 1M files). Some of these files are corrupted and most of them are really small in size (a couple of KB)....
2
votes
1answer
18 views

Use variable inside of command in Makefile

Let's say the LINK variable contains the following: 1a2b3c. I'd like to display Full path: /home/build/1a2b3c.PWD is currently at /home;I can't get the following to work:@echo "Full path: $(...
1
vote
2answers
47 views

$SHLVL does not increase in ( echo $SHLVL)

I am learning shell scripts and stuck at this little experimental shell scripts:1 #!/usr/bin/env bash2 A=13 (A=2;echo "A is $A in $SHLVL")4 echo "A is $A in $SHLVL"5 exit 0Without doubt, $A in ...
0
votes
1answer
33 views

Editing comand prompt

I've changed shell prompt (modifying PS1 variable) for tty1. Is there a way to change the modified prompt for tty1 from tty2 (after switching to tty2 by Alt+F2)?
1
vote
2answers
36 views

Character escaping and echo comand

Having simple echo commands:echo "\n"andecho "\\n"both results in the same output\nCan someone please explain me in details how does bash process such a commands (char by char) and why the ...
-1
votes
0answers
20 views

How did the author create so many different kind of material? [closed]

Here is a abstract from web--http://www.tldp.org/guides.html.Advanced Bash-Scripting Guide version: 10author: Mendel Cooper, last update: Mar 2014available formats: HTML (read ...
0
votes
0answers
13 views

How activate completion in user shell console?

When I uncomment next part in /etc/bash.bashrc for activate completion, # enable bash completion in interactive shells ...
0
votes
1answer
34 views

Command prompt special characters [duplicate]

When setting the value of the primary command prompt (PS1) the followig two cases export PS1="\u"export PS1="\\u"gives the same result:rootas a command prompt string.How does the \u and \\u ...
0
votes
1answer
53 views

'^M' was added to my file after when moving from Win to Linux [duplicate]

I created a .txt file on Win 8 [using sublime] (with copied text for here) and moved it to my VM running Linux.I used cat tmp.txt >> .bashrc to append those lines into .bashrc but mysterious ^...
0
votes
0answers
23 views

SSH private key auth on Windows 10 Bash

i have some Linux installed on by Laptop and use SSH with private key authentication to connect to a server. Recently, I installed Win10 with the bash developer extension on by desktop. Since I only ...
4
votes
3answers
45 views

How to compare two files and output lines which do not appear in the first?

If I have a file A containing a list of fields:2017-04-232017-04-302017-05-072017-05-142017-05-212017-05-282017-06-042017-06-112017-06-182017-06-25And another file B containing a list of ...
0
votes
0answers
23 views

Send “signal” message using terminal/bash

I have installed the desktop signal (messenger) app on ubuntu 16.04 and its working fine. But is there any chance yet to send a signal message by Ubuntu terminal?

153050per page