1,978 Topics
![]() | |
I have an unusual situation where I had a hard drive with some bad sectors and moved the data to a new drive. I did the move with cp -Rfp and >& logfile. I moved the data (~285GB) with about 20 copy commands. The >& should have given me information … | |
I'm trying to write a vbScript that will execute all files in a given directory (will be mostly batch files). I've tried to modify a script that deletes all files but I'm not able to get it to work. Here is what I have: [CODE]Option Explicit '=========================================================================== ' Scheduled Task … | |
Hello. I am writing a script to do some copying of files. I feel confident that I can do that part, but before I even start doing the actual copies, it compares the last modified dates of two files.. I know this seems a very basic question that I would … | |
I am very new in Sugarcrm. I want to send Email in some intervals to all my contacts that I had added in my Sugarcrm account. Is there any facility for the same? If yes then how can I implement it? I want that I will be able to use … | |
Hi, I am writing my output using printf(...) procedure. Sometimes I would like to use bold font.like this [CODE]interface(.... turn bold on :-) .....) printf("something in bold\n"); interface(.... turn bold off :-) ....) printf("something not in bold\n"); Is any way to do this?[/CODE] | |
Hi all, I am trying to write a shell script that submit a couple of jobs .Then in the "job.e.." files looks for the "Finished with all tasks." string and if it exits it continues to lets say step 3 submitting job3 and if not to step 4 and submitting … | |
Hi. In my bash script I have a loop which downloads a few files in the background with 'wget'. How can I make my script wait until all downloads are complete before it goes on? I guess I have to use the 'wait' command after the loop in some way? … | |
Hi , I want to write following contents in a file through shell script. below is the content ------------------------------------------------------- DATE: Wed August 01 2:20 PST 2011 PRODUCT: Quick PRODUCT_VERSION:21.0 PROJECT: QW12 BUILD: 21.1.3.10 PATH: r:\\QW\21.1.3.10 -------------------------------------------------------- Where Build is variable . It should fetch the data from system(i.e. current version … | |
Hi, I have situation where i need to automate transferring 10000+ files using sftp. while read line do if [ -d "$line" ]; then echo "-mput /home/student/Desktop/folder/$line/* /cygdrive/e/folder/$line/">>sftpCommand.txt fi done< files.txt sftp -b sftpCommand.txt stu@192.168.2.1 The above code executes each sftp command written to sftpCommand.txt. If some error occurs while … | |
Hey guys- I'm trying to create a BASH script that will connect to a remote server, via SSH that requires a password, and then search a log file for the word error, store the output in a file, and then return the file to the local machine. I would like … | |
I have a batch file that uses the NET USE command to install some software. The location of the software requires a user to login. How can I ask the user for their username and password in the batch file and then use it in the NET USE string to … | |
consider a list of files in a particular directory(LIST A) 58623208 Sep 14 20:08 blbn_blfbe_drv 57904920 Sep 14 19:54 blbn_cycmn 55814208 Sep 14 06:02 clsa_Upd 38912000 Sep 14 19:12 cs_chgpp and in another directory (LIST B) 58623208 Sep 14 20:08 blbn_blfbe_drv 57904920 Sep 14 19:54 blbn_cycmn 55814208 Sep 14 06:02 … | |
Say like I have hi() everywhere in a shell script and I would like to replace only a hi() to hi(20) right under the line "#modify only the hi() below this line". Is there anyway that I can locate the line "#modify only the hi() below this line" and then … | |
Hi, I am new to Unix/Linux... I have a TCSH shell script (on AIX4) in which, at a certain point, I want the user to be able to pass commands to the TCSH interpreter. What I do is I create the illusion that the user is at his usuall shell … | |
Hi all, I am creating a Rpm .even i have built it.while i am calling my post install script it not prompting the user to enter the input while i am using the read command to take the input.I have read from google that we can't make the interactive RPM's … | |
Hello, So I'm attempting to do a bulk creation of users into Active Directory (Server 2008) using Powershell. I have a script but every time it runs it throws a exception error. I have tried to go through and find what is wrong, but I am having little luck. Any … | |
![]() | Hi, I'm starting to code in python and would like some advice. I'm fairly competent in coding and have been doing alot of VB and shell scripting lately but as python is cross platform I've decided to switch. How do I get python to run programs I have saved in … |
Hi all, I want to run a cpp code a couple of times using a shell. Cpp code needs a text file as an input. I have been trying to pass the file to the cpp code no success. The following is what I have done so far: [CODE]#! /bin/bash … | |
I want to search only in my files, contains only .txt and .c [CODE] This doesn't work for me ls | grep .txt | grep .c[/CODE] I want the ls and grep .txt, .c ??Thanks?? | |
I want to create a simple file....with the command Example: [CODE]touch file.txt[/CODE] ok its created *BUT* ****I want to edit this file in shell and save it, writing EOF to finish. Any suggestions? How i do that? Thanks! | |
Is there some sort of script I can write that logs usernames every time someone (other than owner) "cd's into my pub directory"? any ideas? thanks | |
hey all, im new at shell scripting and need to find out a simple way to create text files, with random words in them. then needing to input 3 of these files arranging their lines in alphabetical order and after that creating an output file with the last lines sorted … | |
Alright, here's the deal.There's a folder with Jpg images and I want to open each JPG image in that folder, rotate it clockwise once and save it with the same name in the same folder. How do I do that with batch programming? We Can't use "Windows Picture and Fax … | |
Hi, everybody! I have a big problem. I don't understand Unix, but I work as a system administrator, and sometimes I make some data exports and I have to delete old .dmp files, but today I had a mistake, I wrote rm * 909* This is a part of my … | |
A friend of mine made this script to backup files from all my ubuntu boxes using lftp to an ftp server i setup on my local windows 7 machine using apache and abilityftp server. However it is only backing up some config files(see attached screen), none of the actual directories … | |
Hi, I want to ftp a file to a location and then kickstart a process there to work on the file. I tried using !rexec but it does not seem to be working too well. I am not using the .netrc file(if that helps you understand my problems better) Thanks … | |
Hi, I was wanting to write a (ba)sh script to allow me to wait for the detection of a new USB device, and when that device is detected, execute some commands. The scripts are intending to be working on the principle that whenever I plug in a usb device a … | |
I attempted to make a shell script to launch a java program packaged into a .jar file. It should have been pretty simple. [CODE] #!/bin/sh java -jar Test.jar [/CODE] but for some reason this script never runs. i've manually executed the command and it works perfectly, i've checked the path … | |
Asking for a Linux command line to convert all files in current folder from UTF8 to ANSI, name unchanged. Best Regards Pei | |
I currently have a small script I've written that basically takes an incremental backup of a folder which looks similar to this: [code] #!/bin/bash cp -ruf /home/folder4/subfolder/ /home/folder5/ cp -ruf /home/folder3/subfolder/ /home/folder4/ cp -ruf /home/folder2/subfolder/ /home/folder3/ cp -ruf /home/folder1/subfolder/ /home/folder2/ [/code] Now this runs fine, only updating the files that … | |
I have a perl application.In one of the low level scripts, it's possible that it must "logout" the user.Basically, exit the shell that this application is running. Are there Any ideas on how to accomplish this? | |
What programming language is fit for shell scripting? And could you add a sample code of a shell? | |
Im trying to scp including password in one line... seems not working. [code] echo "pass" | scp --stdin source destination [/code] However this does work though [code]echo "newpass" | passwd --stdin user [/code] same concept, diff result. Any suggestion would be great. Thanks | |
Sometimes it is hard to locate the exact line you want to modify if there are so many lines having the exact same codes/text. example: #this is x a=0 #this is y #this is yy a=0 this is z a=0 My question is, is it possible to find something unique, … | |
I wrote this small script to convert all sh files in a directory and all sub-directories to resolve a compilation error I was getting with cygwin... [CODE] SETLOCAL @echo off :: Locate all sh files in the target directory and then :: Convert CRLF to Unix Style LF echo Converting … | |
Hi, I recently started working using awk. I am facing a problem to traverse a file row by row. I have a file test.txt which has 2 fields filename and action. test.txt -------- /tmp/a.txt|Action1 /tmp/b.txt|Action2 /tmp/c.txt|Action3 I need to check for the existence of file ($1) in the above file, … | |
Hi, Can you help me how to call two lines from VB Script and give the same in .bat file as input. Here is my VB SCript code.. --------------------------------------------------------------------------------------- [code]Set oShell = CreateObject( "WScript.Shell" ) Set ObjFSO= CreateObject("Scripting.FileSystemObject") Str1="Version=3.1016.0.0" Str2="Version=3.1017.0.0" Getxml1 = "D:\BuildShare\CMS_Maternity\lorenzo tranche2\maternity\webclient\wizard\lorappmaternityslui.web\moduleconfig\modulecatalog.xml" Set objFile = objFSO.OpenTextFile(Getxml1, 1) strText … | |
Hi all, this is a quite simple question. In windows, I wan't to set an environment variable to contain a cmd prompt command that will open an explorer window from the command prompt current directory. I am aware of the >explorer <path> command and want to make use of the … | |
Hi, I wanted to write a C program which searches for text files in a directory(assuming the directory and files are not write protected),list them and open each one of them(files) write a letter A in them.Can anyone give me a sample code. I believe it can be done with … | |
I need to sum up the values of 3rd column and 4th coulmn based on the following conditions 1) If the 1st column (i.e ctpy) of the record matches with any other record && first two character of the 2nd column (ety), matches with first two character matches the 2nd … | |
Hi There I am building some SW modules in Linux environment and at the end of a build the artifacts are stored in the env in a particular folder called HW. This HW folder contains a number of folders underneath for individual targets and those contains one or more folders … | |
Why does this work [CODE] for myfile in `find . -name "R*VER" -mtime +1` do SHELLVAR=`grep ^err $myfile || echo "No error"` ECHO $SHELLVAR done[/CODE] and outputs [CODE] No error err ->BIST Login Fail 3922 err No error err ->IR Remote Key 1 3310 err [/CODE] But this does not … | |
![]() | Hey there everyone! I have an issue with a script with which I had sweated much, and I can't suspend it even if I find another solution for what I want. What I want would be the following: A script that creates a full backup of a directory and all … |
I am looking at building a website that will allow people to sign up and post stats every week about others. For example, Joe has a show dog and likes to compete so Joe comes to to the site and posts. Dog Name: Breed: Weight: Skills: Week 1: Fastest lap … | |
First, I apologize for posting this since it seems to have been addressed for every situation except mine (or so I can find), and I admit I am a complete novice. [B]Intro:[/B] I have a batch file which gets placed in a directory with target files, loops through the files … | |
Hi all, As the name suggests, sriptingnoob by name scriptingnoob by nature! I really need some advice, as I am loosing what little hair I have left. I have a file which contains lines similar to these MACHINE[1]=192.168.10.1 HOSTNAME[1]=MACHINE1 LOCATION[1]=UPSTAIRS MACHINE[2]=192.168.20.2 HOSTNAME[2]=SAGE LOCATION[2]=UPSTAIRS PRINTER[3]=192.168.10.56 etc I want to write a … | |
how to get target path of a shortcut what i want to do - user drag and drop shortcut to the form(i know how to handle drag and drop) . shortcut path have to store in a string plz help me when i google i found codes to do this … | |
I have question about shell command well lets say i have this [CODE] Shell("\bin\game.exe", AppWinStyle.NormalNoFocus) [/CODE] Well as you know the command will come up an say File Not Found [CODE] FileNotFoundException [/CODE] So how can i put this command and when the file is not found turn up with … | |
Hello everyone I have the following code. bat and I would like to convert it. sh, someone could help me? Thank you. [CODE]1) for /F "eol=#" %%i in (%wade-cfg%/boot.properties) do ( set %%i ) 2) for %%F in (%lib%/*.jar) do ( set class-path=!class-path!%lib%/%%~nxF; ) 3) for /f "tokens=*" %%G in … | |
This will be on an automated FTP scheduler... Here is the 1 step I am trying to accomplish: 1. Upon connection to server, the script should: delete all files within the folder '/backup'. That's it... any ideas? |
The End.