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 rc.local file is there any file to edit and use while shutdown.)

Member Avatar
+0 forum 0

Anyone have a shell script to remove controlM character from all the files in a directory

Member Avatar
Member Avatar
+0 forum 14

test for check more 5 items

Member Avatar
Member Avatar
+0 forum 4

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
Member Avatar
+0 forum 1

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 I need this conversion to happen. The "1" and the "template_name" are variable, changing record by record.

Member Avatar
Member Avatar
+0 forum 1

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 end Here is my script i have to use tar and compress by the way. [code] #!/bin/ksh #set -o xtrace DTE=`date +%Y%m%d` TPATH="/apps/prod-dom/prod/data/formatter/MO_app/archive" ############################################################################### #Checking Base Directory available, abort if errors ############################################################################### if [[ ! -r $TPATH ]] then print "Error - Base directory does not exist or is unreadable:" …

Member Avatar
Member Avatar
+0 forum 14

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
Member Avatar
+0 forum 2

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 giving the desired output: its giving some extra delimeters: awk 'BEGIN{FS=OFS="|"}{$4="";gsub(FS,"")}1' file please help

Member Avatar
Member Avatar
+0 forum 12

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
Member Avatar
+0 forum 1

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" -DartifactId="tool-rest" -DarchetypeGroupId=org.apache.maven.archetypes -DarchetypeArtifactId=maven-archetype-quickstart -DarchetypeVersion=RELEASE mvn archetype:generate -DgroupId="com.low.cp" -DartifactId="tool-service" -DarchetypeGroupId=org.apache.maven.archetypes -DarchetypeArtifactId=maven-archetype-quickstart -DarchetypeVersion=RELEASE I want to run this script from java code i am using mac osx i tried every thing my code that is opening this script is as follows: final File scriptDirectory = new File("src/main/resources/"); final String shellScript = "./script.sh"; …

Member Avatar
Member Avatar
+0 forum 2

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 is not possible. Also XCOPy can copy only new files, and returns if files were copied or not. I would like if the bash command did that as well. Here is the XCOPY functional [URL="http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/xcopy.mspx?mfr=true"]specs [/URL]for further reference. You can find if files had been copied or not by looking …

Member Avatar
Member Avatar
+2 forum 10

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 far. Any ideas for what I can add on please**? varSentence = input("Enter the sentence") print (varSentence) varWord = input("Enter word ") import time time.sleep(1) print('Please wait') varSplit = varSentence.split() import time time.sleep(1) if varWord in varSplit: print ("Found word") else: print ("Error word not found.Try again")

Member Avatar
Member Avatar
+0 forum 1

i never used VBScript. how can i use win32 functions?

Member Avatar
Member Avatar
+0 forum 2

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 binary files to the arduino where I will save them to the sd. There are going to be several parts of this project. One part will probably be a shell script or C# script (windows) where I will transfer the files via COM. Another part will be the arduino code …

Member Avatar
Member Avatar
+0 forum 1

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 the one specified file multiple times, based on how many files are in the folder. I've done some digging around and I believe I need to do something like Set objFSO = CreateObject("Scripting.FileSystemObject") objStartFolder = "C:\Files" Set objFolder = objFSO.GetFolder(objStartFolder) Set Files = objFolder.Files For each objfile in Files and …

Member Avatar
+0 forum 0

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 1st 2007(i.e. more than 2 month old). Then it should remove all those listed files, which means, after this script runs, the directory should not contain files created before March 1st.

Member Avatar
Member Avatar
+0 forum 8

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
Member Avatar
+0 forum 1

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 not found couldn't read file "Are you sure you want to use": no such file or directory ./TestScriptPGP.sh: line 7: send: command not found couldn't read file "$": no such file or directory ./TestScriptPGP.sh: line 5: spawn: command not found couldn't read file "Are you sure you want to use": …

Member Avatar
Member Avatar
+0 forum 2

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 each individual filename contained in input.txt, I would like to automate this task by a simple bash script or using another program like awk. I have toyed with using the 'exec' command in bash and contemplated that there must be an easier way using awk or another such program. anybody …

Member Avatar
Member Avatar
+0 forum 7

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. Any help would be really appreciated. Thanks! 1. Filter: `<a href="http://www.gradle.org">Gradle 2.4</a>` at Aug 8, 2015 6:38:46 PM`</p>` --> I want to fetch date and time out of this (Way I thought was to extract between ...at and `</p>` - not sure if I am correct. 2. Filter `<div class="percent">50%</div>` …

Member Avatar
Member Avatar
+0 forum 1

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 some stuff I do at work everyday # tic tac toe game # by shane lindberg #the starting point of available moves $humanmoves = @() $computermoves = @() $whosx = 1 $humanwon = 0 $computerwon = 0 $tie = 0 #pristine new board $box0 = " " $box1 = " …

Member Avatar
Member Avatar
+0 forum 3

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 Ill be to search for it easy. Basically, I should go thru a list of IPs from 192.168.250.0 to 192.168.250.10 and check if the IP is up and running (ping). Once I check it is up and running, I should check for a path //192.168.250.1/PATH and just to be 100% …

Member Avatar
Member Avatar
+0 forum 1

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 would have to search for Thunderbird as well. This would run each time the user shuts down the PC. It would look if the email file and the backup copy have a 48 hour time difference and would do it. The issue with this method is that it has to …

Member Avatar
Member Avatar
+0 forum 1

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
Member Avatar
+0 forum 1

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 ip address and value of DLBbytes or ULBbytes greater than zero. grep -v "0.0.0.0" | grep -vw "DLBbytes:0" | grep -vw "ULBbytes:0" grep -v "0.0.0.0" | grep -vw "DLBbytes:0" | grep -vw "ULBbytes:0" that means the entries like IP:0.0.0.0/0 DLBytes:0 , IP:20.20.20.xx DLBytes:0 should be discarded. But i am getting …

Member Avatar
Member Avatar
+0 forum 2

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 logic PS C:\Users\shane> Function Add ($x, $y){ >> $a = $x + $y >> Write-Host “The Answer is $a” >> } >> PS C:\Users\shane> add 3,6 The Answer is 3 6 I would expect the output to say "The Answer is 9" instead of "The Answer is 3 6" What …

Member Avatar
Member Avatar
+0 forum 1

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 Task category,task summary and creation date.

Member Avatar
Member Avatar
+0 forum 4

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
Member Avatar
+0 forum 2

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 and the corresponding strings in the value column and find the string correctness. How can this be done? Can it be done with shell script or should i follow some other programming.

Member Avatar
Member Avatar
+0 forum 4

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/, apr_bucasdfsadfa_fasdfasfaool.lo, apr_buckets_simpleapr_buckets_simple.lo, apr_buckets_socketapr_buckets.lo, apr_buowekrfwqereqjncckets_reqwer.lo build/, config_vars.sh.in, export_varsexport_varsexport_vars.pl, mkdepphf_abuse_logphf_abuse_logp.perl, rules.mksocketapr_buckets.insocketapr_buckets include/, util_md5util_md5util.h, util_scriptutil_scriptutit.h, util_timeutil_hutil_time.h, util_xmlutil_xml.h os/, ap_regkeyap_regkey.c, MakefileMakefile.in, MakefileMakefileMake, osabuse_logabuse_log.h server/, export_filesexport_files, export_vars.hexport_vars.h, httpd.exphttpd.exp, libmain.lalibmain.la support/, logresolve.pllogresolve, log_server_statuslog_server_status, phf_abuse_phf_abuse_log.cgi, split-logfilesplit-log cat output.txt **Output in file** buckets/, apr_bucasdfsadfa_fasdfasfaool.lo, apr_buckets_simpleapr_buckets_simple.lo, apr_buckets_socketapr_buckets.lo, apr_buowekrfwqereqjncckets_reqwer.lo build/, config_vars.sh.in, export_varsexport_varsexport_vars.pl, mkdepphf_abuse_logphf_abuse_logp.perl, rules.mksocketapr_buckets.insocketapr_buckets include/, util_md5util_md5util.h, util_scriptutil_scriptutit.h, util_timeutil_hutil_time.h, util_xmlutil_xml.h os/, …

Member Avatar
+0 forum 0

The End.