I have a script called installscript which needs a change to the PATH variable. BuildScript file has the following code: Running ./BuildScript or source BuildScript fails with an error in installscript I have made a NewScript and call BuildScript from it after exporting the PATH variable running source NewScr…
Tag: bash
Bash – Insert number variables into command
I’ve been wanting to have a count-up timer overlaying a video but all I could find online for doing so was using Adobe After Effects which isn’t really an option as I’m on Linux and am unwilling to pay for it. So, if I could get a series of images or a video, then it could be imported into O…
od –width=x option isn’t working. My path seems to be correct.
This is in my .bashrc file: But when I run: I get the message “od: –width=10: No such file or directory” Is there something wrong with my path? Answer It looks as if you pasted the –width option from something that improved the double-dash at the beginning of the option. That should be two A…
How do you use wget to download most up to date file on a site?
Hello I am trying to use wget to download the most update to day McAfee patch and I am having issues singling out the .tar file. This is what I have: However when I run the above command it gives me: When I need it to just be the most recent.tar file in between the <a> </a> which in this
bash loop with GNU less that refreshes every 2 minutes
I have a linux machine with a data folder and a script that produces a report xlsx spreadsheet file on the ever changing content of the folder where it is being run. I use a xlsx2tsv script to convert it to tsv text which takes less than one second. The script takes about 1 minute to produce the spreadsheet f…
running bash piped comand from mono linux
I am trying to run bash command with pipe using mono process start here is code snippet I am trying single commands works, however pipe commands fails to run, what am I missing here ? I tried running “ps -aux” which runs fine. However ps -aux | grep gnome command failed. I tried these scenarios sc…
Nested grep with SSH
I have a following Shell command which runs successfully: However, I have to SSH to a particular machine to run this. To avoid this, I modified it in following way which leads to the failure: What is wrong with this command? How can I fix this? Answer Embed your code in a quoted heredoc to avoid needing to mo…
Can’t use multiplication in arithmetic expression
The above is the content of calculate.sh. If I use +, -, or /, I get the correct answer, but when I use *, it reports an error: How can I resolve this problem? Answer The problem was as pointed by others the fact than the character * is interpreted by your shell, be it in your terminal or your
My command line gets colored after I output a colored command in linux terminal
I wanted to have colored ping command output using a shell script. But in the process, I ended up having my command line also colored. Is there any way I can have only my output colored? Here is my bash script: Please see this for example: Answer You need to reset the color after you set it. With tput, this
Looping through the file,searching nan’s
I have file with 12000 lines,some of them are nan’s I have written bash,to search for these nan’s But only this appears on the screen What’s wrong with my bash? Answer you are using exit statement, that means this script will immediately exit after printing FIRST error: Not a number . So wha…