bash

  1. S

    Debian 10, ChromeOS container: only topmost line of text changes when reverse scrolling in 'more'\'less' mode

    Specifically, I'm looking at a manual page for a command. After I scroll down through the manual, attempting to scroll back up results in only the topmost line of text in the terminal updating. Like, if I tap 'k' multiple times, the topmost line will change with each iteration of 'k', but all...
  2. Tolkem

    Can you give some ideas on how to improve script?

    Hi everyone! Hope you're all having a nice life! :) So, I took over practicing/learning bash scripting (once again :D). I'm not very good at it and my knowledge is very basic. Last year I wrote a script to practice the use of if statements if something_happens then do this else do this what...
  3. U

    Encountering IF statement and tee conflict in script

    Hi All I'm looking to be able to correctly evaluate my IF statement and also output what has been backed up into a log file. In the function at the bottom I am stuck between getting the IF statement to evaluate correctly and managing to log what has been backed up (synchronised with rsync)...
  4. P

    Bash: Determining if CANbus Bitrate is Configured Properly

    I'm working on an embedded Linux (4.1.15) bash script wherein the bitrate of a CANbus may be one of several possibilities. When my module comes online it comes up at the first bitrate in the list, checks for traffic, and, if no traffic, cycles through each bitrate in like manner until traffic is...
  5. L

    Need help with Bash

    Hello, Got a Bash Scripting issue. It has to be done with bash. I've been trying everything from SED to other tricks... Can't seem to get it right. I need to be able to replace a whole line with a random number and prefix in a text file. Example: ABCD123456 The letters are the preset prefix...
  6. C

    Alias not working in Bashrc that is a shell script

    Hi All, I've searched Google, and though I'm searching as to why my alias is not working in the bashrc, I'm getting results of alias not working in shell scripts. I have a script that is called digCUST.sh, and I added an alias in my .bashrc file: alias digh="digCUST.sh" I sourced the bashrc...
  7. blueray

    Text Above and Bellow Selected Lines

    I am using Geany. These is a option Edit > Format > Send Selected To > Set Custom Commands Here, for example if I want to sort selected text, I just use sort command. What I want this (Set Custom Commands) to do is put .... above and bellow my selected line/s. For Example if I select the...
  8. R

    Bash generating files with linux lock

    How do I solve bash lock file and directory generation? Every time I create a new file that file is lock-generated
  9. R

    Bash generating files with linux lock

    How do I solve bash lock file and directory generation? Every time I create a new file that file is generated with a lock.
  10. F

    Using Sed to replace some text and add test

    Hello, I have the following records in an LDIF file (actually, I have thousands of these records in the file): dn: cn=userA,ou=users,ou=vault,o=company changetype: modify add: attribute1 attr2: userA dn: cn=userB,ou=users,ou=vault,o=company changetype: modify add: attribute1 attr2: userB I...
  11. L

    Text Based Game in Bash - Help Wanted

    Hello! I am a 16 year old who just got into programming. I am fairly new, but I have been trying to learn Bash. I thought a fun project I can attempt is to to make a small text based game based on "Lemonade Stand" from the late 70s. I created a very simple version (works, most of the time)...
  12. N

    Which linux os have bash and which one have dash?

    Hello everyone, sorry for the basic question but i'm new at Linux... I was curious to know which operating systems have bash shell, because as far as i know ubuntu has dash shell. For me is pretty important to know because the first exam that i'll have at university will be on C and bash shell...
  13. D

    date time diff (bash)

    itry to make date time diff in seconds looked on the web for different soltuin but nothing works for example this are my dates data1=`date +"%d-%m-%YT%H:%M:%S"` and second date i get from query values for example : 03-07-2019T17:25:58 03-07-2019T13:00:00 how do i get time diff in seconds?
  14. iridakos

    Remove duplicate lines from files keeping the original order (one-liner explained)

    Hi all, I published a post providing ways for removing duplicate lines from text files keeping the original order and a thorough explanation of how the awk one-liner works. https://iridakos.com/how-to/2019/05/16/remove-duplicate-lines-preserving-order-linux.html Hope you find it useful
  15. N

    Values rotation in array with bash

    Hello I created a little script that allow to make a rotation of values in an array. The goal was to shift the values to the right and that the last value of the array became the first value in order to create a rotation. The purpose of the exercice was to do it without using a temporary...
  16. C

    Where to learn more about BASH?

    I've come through the advanced tutorial Programming with BASH and I am quite interested in it. So where and how can I learn BASH programming systematically and comprehensively? Thanks in advance!
  17. A

    Passing complier output to bash

    This is one of those "it works fine until...". Background: I am executing bash script to build a C++ library. From options passed to the script it supposedly verify that selected crosscomplier is OK to use. To aid development the compiler is optioned with " -v -V -qversion " in " do...
  18. C

    bash-based Archlinux installer: Arc

    I've been working on a bash-based installer for archlinux. https://github.com/c1ph3r8472/Arc I thought I'd post it here for any who may want to try it / perhaps suggest improvements. The intent is for it to be infinitely reconfigurable via a single config file, thus making reinstallation...
  19. Rob

    bash or fish for shell?

    I've used bash for the past 20 years or so for my go-to shell because it's the default shell on most linux distributions - at least the ones i've used professionally for work. I wanted to make sure whatever I did on my workstation, i'd be able to mimic across the farm. Lately, since I now do...
  20. S

    could anyone help me out??

    if linux systems will not consider anything after # sign in the scirpt, then how come #!/bin/bash works?? #!/bin/bash starts with # sign it shouldn't be consider right??but if the #!/bin/bash is not included in the scirpt its not working??? explain me pls......
Top