66 Discussion / Question Topics

Remove Filter
Member Avatar for
Member Avatar for sandi david

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

Member Avatar for rproffitt
0
37
Member Avatar for Gabriel9999

I have a Java installation and I have only access via bash. How can I check the Java version from command line.

Member Avatar for AlVest
0
94
Member Avatar for Gabriel9999

I want to run a command for ever in the Linux bash. Also I want to put 60 seconds between command execution.

Member Avatar for pritaeas
0
274
Member Avatar for Compiler_Bro's

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 …

Member Avatar for rproffitt
0
378
Member Avatar for fo2sh

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 …

Member Avatar for dcblack56
0
594
Member Avatar for JohnMcPherson

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 …

0
375
Member Avatar for AndrisP

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" …

Member Avatar for AndrisP
0
821
Member Avatar for Dean_5

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 - …

0
286
Member Avatar for Nathan_6

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 …

Member Avatar for Nathan_6
0
1K
Member Avatar for fo2sh

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 …

Member Avatar for rproffitt
0
423
Member Avatar for lewashby

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 …

Member Avatar for Gribouillis
0
452
Member Avatar for ennoil

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 …

Member Avatar for chriswelborn
0
2K
Member Avatar for it@61@sec

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 …

Member Avatar for it@61@sec
0
307
Member Avatar for kww228

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 …

Member Avatar for chriswelborn
0
834
Member Avatar for spowel4

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 …

Member Avatar for cfajohnson
0
555
Member Avatar for cjohnweb

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 …

Member Avatar for cjohnweb
0
336
Member Avatar for Madira

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 …

Member Avatar for Madira
0
354
Member Avatar for Zizou_1

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 …

0
245
Member Avatar for santakdalai90

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 …

Member Avatar for santakdalai90
0
453
Member Avatar for jeansantos

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 …

Member Avatar for masijade
0
412
Member Avatar for JukesK

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 …

Member Avatar for Watael
0
282
Member Avatar for boshu

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 …

Member Avatar for Watael
0
264
Member Avatar for pooh1234qwerty

i am a beginner. i need online tutorial for shell scripting. there are many on the web.. which one to choose??

Member Avatar for DoRight
0
230
Member Avatar for naphets

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 …

Member Avatar for naphets
0
441
Member Avatar for Akusa

I have to write two scripts, one in bash and one in dos. My dos one works perfectly but I'm having trouble with my bash one. The assignment is to make a script that takes a command line argument (from a test script) and return the change. So if the …

Member Avatar for dfl1954
0
404
Member Avatar for replic

Hello everyone, i am fairly new to shell scripting so please bear with me. The following script is supposed to read words from a file and depending on the word print different things. However it always prints the default value. It also refuses to work completely if the first line …

Member Avatar for replic
0
332
Member Avatar for jpreem

So Im using our university servers through an ssh connection. I have a bunch of files in a directory which I would like to run through a perl script. So I thought this simple script I concocted should do the trick. I have used similar script on my home computer …

Member Avatar for TylerD75
0
297
Member Avatar for jdm

I'm almost done with college and I want to work on a side project that I could use to show case my skills. I'm looking for something that I can combine a bunch of different aspect into one. I know this will be a big project and won't be able …

0
175
Member Avatar for it@61@sec

I have a bash script (test.sh) which reads parameters from the command line. The parameters could look like this: param1 param2 param3&ext param4 param5 The problem is that when the script reads the parameters and then echo them I get the following: param1 param2 param3 No command 'ext' found did …

Member Avatar for it@61@sec
0
967
Member Avatar for amnakhan786

hi, i am trying to parse a collection of text files that look like following. there a number of them but not all are structured exactly the same way.if i figure to parse this file i can handle the rest.i am novice in bash, and i want to parse the …

0
94

The End.