1,891 Topics

Member Avatar for
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 asadalikhan
1
338
Member Avatar for Lihui Zhang

For programmers who do not like to use IDEs, it may not be convenient to find specific strings in files of a specified type. Using standard grep is an option, but specifying file types can be quite cumbersome. We can solve this with a small script. First, use find to …

Member Avatar for Lihui Zhang
1
61
Member Avatar for riahc3

First, it has been a LONG time since Ive been here. Good memories from when I was young. Anyways In a monitoring system I have, I had a plugin that remotely checked a SMB share and if the file hasnt been modified in 1 day, it should return a warning. …

Member Avatar for Dani
0
91
Member Avatar for Gabriel9999

I have a script in my system. I want to run this script on the remote system which has SSH connection.

Member Avatar for samueltarcin999
0
139
Member Avatar for Antika2165

Write a shell script to create a directory called “page1” and ask the user if he/she wants to copy a file to TESTING directory. You should find out that the file has read, write and execute permission. If the file has write permission then copy the file to the directory; …

Member Avatar for Reverend Jim
-1
410
Member Avatar for Antika2165

I need some help with the below please! After installation of **[Fedora]** is completed, write a script called your LastName_StudentID.sh to obtain following options information: * Get information about your operating system, * Get information about hosts * Network interface and routing information * Display a list of users currently …

Member Avatar for rproffitt
0
660
Member Avatar for cwriter77

What I like to know is if network programs still use this file? I can comment out http port 80 without any effects on firefox: ># http 80/tcp ># http 80/udp Then I can delete out /etc/services without no serious effects on the system: >sudo rm -v /etc/services The best …

Member Avatar for AndrisP
0
408
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
597
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
381
Member Avatar for JIBY_2

#!/bin/bash v="test" result=`grep 'Dir=' /home/xtend/Videos/file.ini | cut -d'=' -f 2`; foo="$result" foo+="$v" echo $foo answer expecting(/home/file/test) answer getting(teste/file) (In "/home/xtend/Videos/file.ini" "Dir=/home/file/") ... how it is outputing like this?

Member Avatar for rproffitt
0
336
Member Avatar for Jiby_1

I have wriiten a script to switch on buzzer and given the path of that script in '/etc/rc.local'. So after booting my script works and it make the buzzer to switch on... my question is i want to switch the buzzer off when my device is shutdown.(for startup we use …

0
389
Member Avatar for Dev_9
Member Avatar for Kang_1
Member Avatar for breaksand30

I'm working on a project in Python that I'm having trouble with. I've asked so many people but they seem to not be able to help me :/ I'm coding a little program that executes system commands. The idea is that one machine opens the server and the other one …

Member Avatar for reeta_1
0
4K
Member Avatar for ahmed Farhad

Hi, I was wondering if anybody could help me with this. I have two .csv file that I need to put it in an excel file in two different tabs using Shell Script. Thanks in advance.

Member Avatar for rproffitt
0
367
Member Avatar for Thomas_32

I have a JSON file, and I need to convert some of the entries into anchor tags. I think a regular expression is the way to go, but I'm terrible with them. I need to convert: "id":"1","template_name", into: "<a href='getTemplate?1'>template_name</a>", The text "id" is hard-coded, present in every instance where …

Member Avatar for rproffitt
0
427
Member Avatar for riahc3

(Ubuntu Server) I have a folder full of files in pairs (one is a log, another is a DB backup) They are basically create/modified at the same time. I need a shell script that detects if the folder has more than 28 or 30 files (always will be a pair), …

Member Avatar for rproffitt
0
512
Member Avatar for skelly16

Hi All Anyway of resolving this issue. I have created a script which works properly only issue is occasionaly when the tar.Z file is emailed to me i get this message this only happens sometimes?? begin 644 /var/tmp/aimtl-20080626.txt.tar.Z M'YV08=*TH=.&#9LP+63 @($#A@T9-ES0P4,'@,6+&#-JW,BQH\>/( $L7&B# M!@V1,&+ H $1)0R%-6"@E!$CQ@T;,6C,D &@)HP9,60HC%'#!DJB,&KPE!FR MJ=.G4*-JK#.'3A@Y*.O@4)B4I]2,;\CDF3.G3)ZO&4>FE%'#Y4BC:./*G4NW M;MTI5*9\H2(G#)DR7Y(022#DS9LU@0</J2-'3ADW8_)\&1*V3 *^?@%3R0/' M\I,[;LK(^3(%BI,$GT./9E($-6C17YY426 E#)LZ8>BD>>-F+V?+4^@X#M,F …

Member Avatar for Chezi_1
0
3K
Member Avatar for Hi

how do i make a code that willfind the distance wether or not your speed is a float or an integer. please help i get no assistance in my class as techer is awful

Member Avatar for ddanbe
0
664
Member Avatar for nikita.

Hi, i want to delete a column from a file. the file is like : 1|2|3|4|5|6|7|8|9|0 1|2|3|4|5|6|7|8|9|0 1|2|3|4|5|6|7|8|9|0 1|2|3|4|5|6|7|8|9|0 1|2|3|4|5|6|7|8|9|0 1|2|3|4|5|6|7|8|9|0 if i want to remove any column the outout should be like ( suppose 4): 1|2|3|5|6|7|8|9|0 1|2|3|5|6|7|8|9|0 1|2|3|5|6|7|8|9|0 1|2|3|5|6|7|8|9|0 1|2|3|5|6|7|8|9|0 1|2|3|5|6|7|8|9|0 i have used swk command, but its not …

Member Avatar for Liam Huang
0
2K
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
2K
Member Avatar for RudyM

Hi all, I would like to replace new lines with "<BR>" in a text file. I'm executing the following line in Powershell: `[regex]::Replace((Get-Content "testfile.txt"), "\.``n", ".<BR>", "Singleline")` The contents of testfile.txt: Some text here for paragraph one. More text for paragraph two.

Member Avatar for RudyM
0
400
Member Avatar for new_2_java

Hello everyone, I am trying to merge large number of CSV files into one, using the following "awk" command, but if I increase the number of files more than 10,000, it then gives me "argument too long" error. Can someone suggest how I can manage to go beyond the limit? …

Member Avatar for Gribouillis
0
1K
Member Avatar for reenabiew
Member Avatar for khaled_jawaher

Hi i have a shell script named script .sh that create maven project having parent pom and multiple modules under it as follows: #!/bin/bash mvn archetype:generate -DgroupId="com.low.co" -DartifactId="tool-release" -DarchetypeGroupId=org.codehaus.mojo.archetypes -DarchetypeArtifactId=pom-root -DarchetypeVersion=RELEASE cd yeti-release mvn archetype:generate -DgroupId="com.low.cp" -DartifactId="tool-api" -DarchetypeGroupId=org.apache.maven.archetypes -DarchetypeArtifactId=maven-archetype-quickstart -DarchetypeVersion=RELEASE mvn archetype:generate -DgroupId="com.low.cp" -DartifactId="tool-impl" -DarchetypeGroupId=org.apache.maven.archetypes -DarchetypeArtifactId=maven-archetype-quickstart -DarchetypeVersion=RELEASE mvn archetype:generate -DgroupId="com.low.cp" …

Member Avatar for JamesCherrill
0
457
Member Avatar for Shane_Warne

Hi all, Can you please tell me if there is a bash command in UNIX that is similar in functionality to XCOPY in Windows? XCOPY can copy who directory trees from a source folder to a destination folder, but from what I saw about the cp command in bash, it …

Member Avatar for davidchengnoc
2
3K
Member Avatar for Prithiviraj_1
Member Avatar for rubberman
0
187
Member Avatar for nic56208

I'm making a program that identifies the word position in a sentence. For example, in the sentence ASK NOT WHAT YOUR COUNTRY CAN DO FOR YOU ASK WHAT YOU CAN DO FOR YOUR COUNTRY The word 'COUNRTY' appears in the 5th and 17th positions. **This is what I have so …

Member Avatar for Gribouillis
0
511
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
427
Member Avatar for cambalinho
Member Avatar for overwraith

I am trying to build a program for transferring files to an arduino project with an attached sd card. I have some code, it does some interesting stuff, but it's not quite what I want it to do. What I need it to do is to be able to transfer …

Member Avatar for rproffitt
0
825
Member Avatar for TJoF

I am very new to powershell and I am attempting to import multiple csv files into a SQL database. I have it working if I specify the file but I want to have it import multiple files from a specific folder. The way it's working right now, it will import …

0
331
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
460
Member Avatar for BobFX

Hi, I have built a shell extension handler, using this as a template: https://code.msdn.microsoft.com/windowsapps/CppShellExtContextMenuHandl-410a709a In this instance, it registers with a ".ts" extension: hr = RegisterShellExtContextMenuHandler(L".ts", CLSID_LNtoALL, L"CppShellExtContextMenuHandler.LNtoALL"); The project compiles fine, and the registration works also. But on one PC, it fails to load (the context menu for .ts …

Member Avatar for BobFX
0
369
Member Avatar for abhilashnair

I need to write a shell script that will filter out all files in a directory that are more than two months old and then remove those files. Example: Suppose I am running this script on May 1st 2007. It should list out all files which are created before Mar …

Member Avatar for jwebster91
0
2K
Member Avatar for Manish_10

Hi, please can anyone help me with the following issue? issue: todays date is 20150819 and my data contains date as 20141001. I want to read this date i.e. 20141001. please tell me how to read the previous year date??

Member Avatar for ravi_14
0
316
Member Avatar for ananddvk

For loop is not working with expect in pgp encyption script. ========= -bash-4.1$ more TestScriptPGP.sh #!/bin/bash #!/usr/bin/expect -f for i in `ls *.txt` do spawn /opt/PGP/pgp -e +force $i "<abc@gmail.com>" expect "Are you sure you want to use" send "y\n" expect "$" done; -bash-4.1$ ./TestScriptPGP.sh ./TestScriptPGP.sh: line 5: spawn: command …

Member Avatar for Roger_4
0
660
Member Avatar for script_noob

input.txt is a file that contains filenames that have been piped into it from an external program. for example... input.txt has the following in it filename1.txt filename2.txt filename3.txt I would like to perform an 'rm' command on the filenames contained in input.txt So instead of potential hours of work deleting …

Member Avatar for r 7vtgj
0
9K
Member Avatar for jpratik21

I am trying to filter/parse HTML tags mentioned below to get the desired output (mentioned). I have tried so far with `sed` & `grep` but was only able to extract the content between the starting and closing tags. However, I want to be more specific like below I have mentioned. …

Member Avatar for rch1231
0
2K
Member Avatar for shanenin

I am trying to get in the habit of practicing coding on daily basis. I decided to try do do tic tac toe in powershell. This took my a rediculous amount of hours to finsh. I am glad to be done. Nest projec will be something more useful like automating …

Member Avatar for Nutster
0
1K
Member Avatar for riahc3

I have a mobile VPN client that I want to backup to. The problem is that it does not have a static IP to due it being L2TP/IPSec. Thats the bad news. The good news is that there wont be too many VPN clients (at most 10 if that) so …

Member Avatar for Kayasax
0
365
Member Avatar for riahc3

I'm looking for the best way to back cold backups of the email on my client's PC. Starting off with PowerShell, I would run this: Get-ChildItem -Path 'C:' -Filter '*.pst' -Recurse -ErrorAction SilentlyContinue | Select-Object -Expand Directory -Unique | Select-Object -Expand FullName To search where the email file is. I …

Member Avatar for Kayasax
0
501
Member Avatar for riahc3

I see most PowerShell questions being asked in Shell Scripting and its not really a scripting language per say as it is much deeper than that. I porpose it gets its own section...

Member Avatar for pritaeas
0
313
Member Avatar for clife

Hi, I have the a file which contains information as mentioned in the below format. IP:20.20.20.50 DLBytes:0 IP:0.0.0.0/0 DLBytes:0 IP:20.20.20.52 DLBytes:0 IP:0.0.0.0/0 DLBytes:0 IP:20.20.20.53 DLBytes:187329 IP:0.0.0.0/0 DLBytes:17176 IP:0.0.0.0/0 ULBytes:0 IP:20.20.20.50 ULBytes:0 IP:0.0.0.0/0 ULBytes:0 IP:20.20.20.52 ULBytes:0 IP:0.0.0.0/0 ULBytes:187329 IP:20.20.20.53 ULBytes:17176 I am using below commands to extract entries which have proper …

Member Avatar for clife
0
365
Member Avatar for shanenin

I don't understand why my function is not giving similar output as the first example of powershell code PS C:\Users\shane> $x = 3 PS C:\Users\shane> $y = 6 PS C:\Users\shane> $a = $x + $y PS C:\Users\shane> Write-Host "The answer is $a" The answer is 9 My function using similar …

Member Avatar for shanenin
0
339
Member Avatar for Manikanta Sharma

I have a requirement to generate an auto ticket/email when it's time for a scheduled task to be done and it should repeat again when it's time for performing the task. Could you please help me with the script/how this can be done I'm gathering the information to a table …

Member Avatar for Nutster
0
472
Member Avatar for sachin19

find /home/scott/xyz -name "*.log*" -not -name 'access.log' -not -name 'server1.log'-exec cp -i {} /home/scott/zxc/. \; I want to run this command but It doesn't seem to work for two files.How can I achieve this?

Member Avatar for sachin19
0
201
Member Avatar for sheelakumari

I have two text files one file contains values as Id Value 1 apple 2 orange 3 mango 4 banana 5 strawberry 6 papaya In other file i have Id Value 6 strawberry 4 banana 3 orange 1 mango 2 papaya 5 straw berry I have to match between Id's …

Member Avatar for parvai
0
340
Member Avatar for ManojRajput

Hi, Below is the code i am using. On console output is fine but when i am redirecting output to file then single line is breaking in multiple lines. Please help. for dir in */; do printf "%s, " "$dir"; ls -m "$dir"; done **Output on Consloe : ** buckets/, …

0
216
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

The End.