1,890 Topics

Member Avatar for
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
330
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
454
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
368
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
658
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
362
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
496
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
312
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
364
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
336
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
470
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
200
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
337
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
215
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 larin83109

Hello again dear Daniwebians, I am asking for some ehlp again. I wrote a littel cript as part of my assigment. My script does what it is suppose to do, but when I run it, it does not end on its own, I have to stop it by "killing" the …

Member Avatar for cfajohnson
0
273
Member Avatar for mkoliwad

Hi All, I need your valuable suggestion as how to sort the log files based on timestamp. Below is the sample log content. string May 28 22:07:48 2015 Log data string May 28 22:07:48 2015 Log data string May 28 22:07:48 2015 Log data I would like to sort based …

Member Avatar for mkoliwad
0
236
Member Avatar for whizkidash

Team, Presently i have some 20 files which i need to copy and store in the common directory. below is the example: script name: dir.sh cp /tmp/abc /home/abc/xyz cp /tmp/def /home/abc/xyz cp /tmp/hij /home/abc/xyz The above script is run, it copies the source files on the destination directory(xyz), wanted to …

Member Avatar for cfajohnson
0
461
Member Avatar for Kevin_17

I have a question is there any possibility for maken a script that you can see if computers are on in your network when you run the script for ex. ./ping.sh 54 62 62 , a script when you give as argument the last digit of the ip adres of …

Member Avatar for cereal
0
302
Member Avatar for Ian_7

Writing a PSUnit test case where I need to get a specific value from a single row in the data table that was generated from my separate powershell function. To do this I figured I could use a foreach loop, but I am not sure how to write the inner …

0
115
Member Avatar for Conor_1

Write a script which accepts some number of arguments and outputs those arguments sorted into alphanumerical order, with each argument on its own line. im usin linus

Member Avatar for happygeek
-1
159
Member Avatar for Gurjit_1

Hi guys , i have found command to extract the output of a command and save it in a file. But I want whenever I extract the data from a command , it should start from a particular line ? I am using this command below to extract data of …

Member Avatar for Rambino
0
230
Member Avatar for Atharva.

I want to write a shell script which finds main() in the given folder files and sub folder files

Member Avatar for Gribouillis
0
228
Member Avatar for hussainv1

We have QA automation jobs that invoke user interface tests in Firefox running on a virtual Linux host. My tests perform regression, but I'm held up because of the Firefox This Connection is Untrusted warning. My current requirement is to ignore this connection untrusted warning, which comes up when accessing …

Member Avatar for rubberman
0
241
Member Avatar for roshnicse

Hi....below is my .csh file. In this foreach n, i have runned my algorithm 10 times. But now i want it to run(iterate) 1000 times. i.e. foreach seed(1 2 3 4 5 6 7 8 9 10 11 12......1000). I tried using awk'BEGIN{for(....);}'.But still its not working...please help. foreach n( …

0
122
Member Avatar for nick jackson

write a Bash script file that implement the RSA algorithm. The user has to enter on the command line some parameters and options, which will determine the behaviors of the script. The syntax of the shell command is $ your-shell-file-name –p<file> –q<file> –e|-d [-i <filename>] [-o <filename>] OR $ your-shell-file-name …

0
104

The End.