Linked Questions

1 vote
1 answer
55 views

On Linux Mint, using bash.. test="-ffoo"; echo ${test:0:2} works outputting the first two characters but test="-efoo"; echo ${test:0:2} fails, with apparently null output. I'm thinking the form ...
David Brown's user avatar
1 vote
2 answers
84 views

I have two comma separated files as mentioned below, cat source.txt A,1000 B,3000 C,2500 D,5000 E,4000 F,3000 cat test.txt A,1000 C D,5000 B E How can I update file test.txt by referring file source....
Swapnil Dhule's user avatar
1 vote
3 answers
103 views

I have come across some odd behaviour while using the find command that I cannot find an explanation for. I have a .txt file with 1 filename per line and I am using the find command to recursively ...
Isaac's user avatar
  • 11
0 votes
0 answers
118 views

I want my terminal prompt to change color depending on success of the previous command. Currently I achieve this with the following script: exitstatus() { if [[ $? == 0 ]]; then echo -e &...
Trashbin2019np's user avatar
0 votes
1 answer
78 views

I created the following function is ~/.bashrc: function cl {cd $1; echo $1; ls -al $1} (I put the echo command in there just to see what it's actually reading in) In my home directory, I created a ...
Rapid Readers's user avatar
-1 votes
2 answers
197 views

i grep something like: str='"a\nb"' echo ${str} | grep -E -o '".*"' and got: "a\nb" i wish the result displays like: a b how could this be done? thanks p.s. actually, ...
furynerd's user avatar
-1 votes
2 answers
79 views

I would like to be able to do something like this VAR='\\' echo "$VAR" and get as result \\ The result that I actually have is \ Actually, I have a very long string with many \\ and when ...
JINJA JINJA's user avatar
0 votes
1 answer
68 views

I used the following syntax to read in a file name and modify its extensions to generate the name of a matched data file. As an example, I have ABC_1.fastq.Blockxy, XYZ_1.fastq.Block34 and I want to ...
Max's user avatar
  • 101
0 votes
1 answer
69 views

I was using a bash script to do some automated testing on a CLI. All of a sudden it does not seem to work. Seems like our devops have done some changes to the OS. The error i see is bash-3.2$ sh ...
sovenkat's user avatar
0 votes
1 answer
71 views

I have a script that needs to format numbers with thousands separators. So 1234567 becomes 1,234,567. I use printf "%'d" 1234567 to get the result. Works fine. Later in the script I set ...
gldrplt's user avatar
0 votes
0 answers
91 views

when it comes to the echo -e command, of course you can do a lot with it when it comes to printing color text, especially when it comes to making terminal based UIs, but I have one main question, does ...
AuraWare's user avatar
0 votes
0 answers
76 views

As a part of my bash routine I am printing some message in terminal regarding status of the workflow. The message in splited into two parts (part 1: begining of the task, part 2: status of its ...
Hot JAMS's user avatar
  • 197
0 votes
2 answers
68 views

say I want to add the current directory to path. I need to run echo "export PATH=$PATH:$(pwd)" >> ~/.bash_profile. this expands $(pwd) like I wanted, but it also expands the $PATH ...
notacorn's user avatar
  • 101
0 votes
0 answers
43 views

What is the difference between running the echo command with argument passed in quotes v/s without quotes? echo -e hi\n # Output = hin echo -e "hi\n" # output = hi (with extra new line) ...
manish thakur's user avatar
0 votes
1 answer
40 views

I have example sub-directory names such as: Test_ABCDEF_406_1 Test_ABCDEF_AOH_1 Test_ABCDEF_AUQ_1 within a larger directory called Test. How can I efficiently pull out "ABCDEF_**_" or ...
MAtennis9's user avatar

15 30 50 per page
1
23 24 25 26
27