72 Topics
| |
i’m looking for the steps to write a c program which work as the command PS and i know that i should read the information from pseudo file /proc but i don’t know how …and any simple code to help me understanding that... thanx | |
I have a Java installation and I have only access via bash. How can I check the Java version from command line. | |
I want to run a command for ever in the Linux bash. Also I want to put 60 seconds between command execution. | |
I'm new to Linux and the first thing I did was right clicking to find refresh as always I did in windows. .... but then I was disappointed to find nothing, no refresh , but why and it just amazed me how better linux is !!! Linux distro Kali linux … | |
Hello everybody, I have the following records in a file. > 15:00:00.870;334 > 15:00:00.872;1314 > 15:00:00.889;334 > 15:00:00.890;334 > 15:00:00.891;334 > 15:00:00.892;334 > 15:00:00.909;212 > 15:00:00.910;334 > 15:00:00.929;334 > 15:00:00.948;334 > 15:00:00.950;334 > 15:00:00.969;334 > 15:00:00.970;334 > 15:00:00.990;334 > 15:00:01.010;295 > 15:00:01.011;334 > 15:00:01.012;334 > 15:00:01.029;334 > 15:00:01.030;334 > 15:00:01.048;334 … | |
Hello, my name is John McPherson. I work for the DOL, in the Uneployment Insurance office, and I am working on an application that uses bash scripts as the controller running the application. I am trying to add a capability to email the output files to the users, which are … | |
How i can `sed` save pattern matches to variables and do something with it? eg $ echo "string_4.3.2" | sed 's/^string_\([0-9]\)\.\([0-9]\)\.\([0-9]\)$/\1 \2 \3/' output "4 3 2" but I want to pass variables to function eg do_something() { echo $1 echo $2 echo $3 # ..... # ..... } string="string_4.3.2" … | |
What it says on the tin. When the system (without logging into X) detects a change in internet accessibility, I'd like to set a hook to execute a script. EDIT: Every single bloody time... So, [dhcpcd-run-hooks](http://roy.marples.name/man/html8/dhcpcd-run-hooks.html) exists... is that the preferred method or can anyone recommend something else that's - … | |
| Hello everyone. I realize that this may be an elementary question, but all of my searches for answers have not given me a satisfactory result. In my ubuntu server machine, I typed in [after examining my stty settings] `werase='^I'` as I was configuring the terminal to my likings. All was … |
Hello Everybody, I am trying to run a simple script to monitor a log file, where I need to send an alarm every time specific line is being written into this log file, currently my script is working fine, the problem is with the miltiple lines that is being written … | |
garrett@mint-desktop /var/www/html/udemy/php-oop/gallery/backups $ tar --exclude-tag-all=backups -cf lesson20.tar ../* tar: Removing leading `../' from member names I have an empty file called backups in my backups directory to keep the tar file from trying to backup itself. Does anyone know why I'm getting this output? -> `tar: Removing leading ../' from … | |
I have (roughly) the following code: read -p "What is your variable: " WHATIS cat > ./test.txt <<EOF This should be a bunch of lines I want this "variable" to be imbedded it is ${WHATIS} EOF I keep getting the literal output of "${WHATIS}. I did this ages ago but … | |
I have a C++ program with a main routine which reads arguments from command line: int main(int argc, const char *argv[]) In my system I have defined some aliases in my bash environment which abbreviates directory names. Example: alias dst='home/username/Documents/test' alias src='home/username/Download/test' My program is called "dircopy" and I want … | |
Grabs the location and name of the script file itself. | |
I am working on a shell script that takes a single command line parameter, a file path (might be relative or absolute). The script should examine that file and print a single line consisting of the phrase: Windows ASCII if the files is an ASCII text file with CR/LF line … | |
A 22 year old vulnerability, yes you read that right, has been discovered which some security experts suggest could be bigger than Heartbleed. The bug, reported as '[CVE-2014-6271:remote code execution through bash](http://seclists.org/oss-sec/2014/q3/649)' relates to how environment variables are processed: with trailing code in function definitions being executed independently of the … | |
I am defining the following variables inside a bash script (note: I ultimately want to pass these values to the bash script from the commandline but I haven't gotten that far yet): OFS=',' INPUTFILE='~/data.txt' OUTPUTFILE='~/delimited.txt' FIELDWIDTHS='1 10 4 2 2' Next, inside the bash script I'm attempting to call an … | |
Hello! I am normally in the PHP / Web Development section of DaniWeb. It's a pleasure to finally have a reason to check out other sections of DaniWeb! So, I am logged in as root at the Command Line Interface over SSH - on Debian 7 Wheezy running on a … | |
I want to find common line in two files and replace the next line of first file with the next line of second file. (sed,awk,perl,bash any solution is welcomed ) Case Ignored. Multiple Occurrence of same line. File 1: hgacdavd sndm,ACNMSDC msgid "Rome" msgstr "" kgcksdcgfkdsb msgid "" hsdvchgsdvc msgstr … | |
Month CBS GFS HR HR Payroll INCV cbs1 gfs1 hr1 hr2 hrm incv1 Baseline <=97 <=125 >=11 >=19 <=25 10 (6mths) 2013-07 97 89 14 28 30 4 2013-08 58 103 18 6 24 18 2013-09 54 110 11 14 25 17 2013-10 108 129 17 8 23 18 2013-11 … | |
I am trying to search for a shell script if it is running and then assigning the count to a variable. Let the script be ScriptXYZ.sh. I wrote: proc_count=$(/bin/ps -ef | grep ScriptXYZ.sh | grep -v grep | wc -l) The problem that I am facing is that even when … | |
I need a script that connects to a device on my network and export a list of data... #!/usr/local/bin/expect -f spawn telnet hostname expect -exact "Username:" send -- "username\r" expect -exact "Password:" send -- "password\r" expect "#" send -- "command\r" interact expect "#" send -- "logout\r"` I get some desired … | |
i've just given a script to update and maintain by my manager, but its bash and i dont know that much about it.. i currently have a script that looks through .txt files for given serials that then reports to a php webpage. within this script we have around 20 … | |
I'm no pro when it comes to BASH, but I have been known to shell-script my way out of a problem here and there. One of the useful things you can do is a for-loop, whether it be used on file names, script arguments, or just a string of words. … | |
I'm no pro when it comes to BASH, but I have been known to shell-script my way out of a problem here and there. One of the useful things you can do is a for-loop, whether it be used on file names, script arguments, or just a string of words. … | |
This is another useful script I came across. It prints a color-code chart in your terminal. It can help you find the color-code you are looking for, or view the current color-scheme you are using (people use it on reddit/r/unixporn to show off their system's theme, I use it to … | |
I didn't write this, the credits are in the code. It's a code-golf version, and I'm sorry about that. I am trying to 'decode' it but I don't have the skills, so the 'decoded' version doesn't have the right colors. This is an example of what you can do with … | |
Hi, I am trying to write a small shell script that will take user input on SVN branch and validate that the requested branch exists in SVN. And then continue with other operations if the branch is valid. I tried the following but seems its not working right: VALID_BRANCHES="4.2.1 4.1.0 … | |
i am a beginner. i need online tutorial for shell scripting. there are many on the web.. which one to choose?? | |
I have a bash script that executes @ init level 3. I would like to "wrap" (for lack of better word) this bash script in a php script. Use the power of php to supress any output from the bash. Also display only the splash logos (like what you see … |
The End.