1,892 Topics

Member Avatar for
Member Avatar for voidyman

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 …

Member Avatar for voidyman
0
104
Member Avatar for Sudo Bash

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 …

Member Avatar for Sudo Bash
0
259
Member Avatar for Digitalwolf

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 …

Member Avatar for Digitalwolf
0
210
Member Avatar for jiapei100

Asking for a Linux command line to convert all files in current folder from UTF8 to ANSI, name unchanged. Best Regards Pei

Member Avatar for griswolf
0
282
Member Avatar for Borzoi

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 …

Member Avatar for JeoSaurus
0
210
Member Avatar for maninaction

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?

Member Avatar for rch1231
0
131
Member Avatar for earlybirdsean

What programming language is fit for shell scripting? And could you add a sample code of a shell?

Member Avatar for cfajohnson
0
196
Member Avatar for k2k

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

Member Avatar for maninaction
0
546
Member Avatar for k2k

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

Member Avatar for k2k
0
129
Member Avatar for Satyrn

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 …

0
72
Member Avatar for Member24

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

Member Avatar for JeoSaurus
0
247
Member Avatar for etm9413

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 …

Member Avatar for Aia
0
190
Member Avatar for digitalhead

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 …

Member Avatar for ashok.bandari88
0
220
Member Avatar for mkbuster

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 …

Member Avatar for mkbuster
0
468
Member Avatar for boshu

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 …

Member Avatar for boshu
0
132
Member Avatar for kristo5747

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 …

Member Avatar for Fest3er
0
236
Member Avatar for Pityu

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 …

Member Avatar for Fest3er
0
225
Member Avatar for quibbie

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 …

Member Avatar for MagicMedia
0
165
Member Avatar for neely615

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 …

Member Avatar for griswolf
0
333
Member Avatar for scriptingnoob

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 …

Member Avatar for L7Sqr
0
112
Member Avatar for y2kshane

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 …

0
126
Member Avatar for MarkGia

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 …

Member Avatar for MarkGia
0
454
Member Avatar for juan77

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 …

Member Avatar for griswolf
0
119
Member Avatar for tmparisi

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?

Member Avatar for JeoSaurus
0
33
Member Avatar for braintwister17

Hi Everyone , I am currently learning shell scripting.So I just need little help from you. If you know sites which have good shell programs / questions for practice (solving ) .. please post them here. If you can provide any alternative regarding my study on shell scripting that would …

Member Avatar for IIM
0
146
Member Avatar for stroganoff23

Hi , how can I use the at command to find me in a specific point of time upon logging in? which it will display on screen a txt file at the same time. Thanks in advance

Member Avatar for IIM
0
99
Member Avatar for emanfman

Well, well. I was looking for a program online. And so, it appeared as a [ICODE].bat[/ICODE] file. However, It looked suspiciously small at 53 kB. So, before I ran it, I opened it up in notepad and voila, a virus. So, I shredded the file with the windows 7 shredder, …

Member Avatar for sknake
0
144
Member Avatar for Code12345

NOTE TO MODS: I wasn't sure in which category my question would fit in so if i have posted in a wrong section plz move it in the right section.Thanks Ok guyz here is the problem. I have a router which is accessed from the browser. I also have to …

Member Avatar for jingda
0
259
Member Avatar for SakuraPink

Hi everyone, I have a text file which looks like this: [CODE] ( 3,3,0 ) 0.9984104 0.000503 ( 3,3,1 ) 1.000613 0.000484 ( 3,3,2 ) 1.001192 0.000571 ( 3,3,3 ) 1.002418 0.00063 ( 3,3,4 ) 1.003345 0.000583 ( 3,3,5 ) 1.000215 0.000512 ( 3,3,6 ) 1.000911 0.000537 ( 3,3,7 ) …

Member Avatar for Aia
0
319
Member Avatar for SakuraPink

Hi there, Here is the problem: I have a Text file with several hundreds of lines and I want to store line 100 to 200 in another text file. I wrote the following piece of code but result is all of the lines not just the ones that I need. …

Member Avatar for SakuraPink
0
246
Member Avatar for _neo_

Hi all. I need to highlight comments on mcedit. 1) comments start with "--" 2) comments may may end with "\n" or with "--" how to do it in mcedit syntax file? These lines are my syntax file content which responsible to highlight comments context -- \n brown # here …

Member Avatar for _neo_
0
262
Member Avatar for manish250

hello all i have a jap project.in which i have a lot of log(txt) files.what i want to do is searching a particular number in all log files and cut some fields of lines containing that number and show them as table in jsp page. currently i am using shell …

Member Avatar for kingman123
0
89
Member Avatar for sjgriffiths

Hello I want to sort a file and then uniq it, but ignoring the first field so i have REF | FOR | SUR TLT090991|STEPHEN|GRIFFITHS TLT090992|STEPHEN|GRIFFITHS So i want to uniq but ignore the REF field I had this but it doesnt work cat $FILE | sort -t '|' -k2,3 …

Member Avatar for JeoSaurus
0
303
Member Avatar for _neo_

Is there a way to get current date and time from remote windows machine on linux? On remote windows machine ssh not enabled, there are no powershell. Can we achieve result via telnet or smbclient?

Member Avatar for _neo_
0
2K
Member Avatar for vasuv

Hi All, We are using one application. This application is having 2types of jobs. Under each job again there are each 5 sub jobs. All the jobs are scheduled jobs. Now the requirement is The main 2 jobs we are going to run on some specified days( for this we …

Member Avatar for IIM
0
156
Member Avatar for divineelite

I am using ShellExecute(NULL,"open","control.exe","ncpa.cpl","c:\\windows\\system32\\",SW_NORMAL); to open the Network Connections window. That is working on my system which has Windows XP on it. But when I make a build for the machine on which this program has to run it doesn't work. It has Windows Embedded on it. I guess it's …

Member Avatar for gerbil
0
198
Member Avatar for Shruti4444

Trying to code a shell script for a program testing. i need to check for the existence of particular word in outfile and then proceed further, which i am not able to do. I have wrote the following code. Please tell the corrections.. The control does not pass to the …

Member Avatar for IIM
1
134
Member Avatar for happy8899

[CODE] set a = 3 set type = a echo $($type) [/CODE] How for me to get value of 3 from variable $type which is a. I can't get value 3 from what i do above? please help thanks!

Member Avatar for IIM
0
161
Member Avatar for Beat_Slayer

Well, it bothers me to build menus for every shell application that needs one. So, I've written a module to handle that, like in the good old turbo pascal times. :) Here it is, the module comments are pretty explainatory, I think, and the sample usage if run as script …

Member Avatar for Beat_Slayer
0
3K
Member Avatar for anjoz

I need to make a recycle bin code using bash my problem is that i dont know how to get the previous path of the files that ive deleted so when i restore it it will go to the directory that it was deleted from ive tried putting the paths …

Member Avatar for JeoSaurus
0
364
Member Avatar for landog

How do I test whether the first character in an array is a particular character? [CODE] i=0 while [ $i -lt $# ]; do strng=${args[i]}; if [ $strng[0] == '-' ] echo ${array[i]} let i=i+1 done [/CODE] Better yet - can I test the first character in an array of …

Member Avatar for landog
0
98
Member Avatar for anjoz

how do you compare comandline arguments in bash example i have 5 or more arguments and 2 of the arguments are the same how can do it any suggestions? my problem is that i need to compare 2 or more arguments if any of the arguments are the same sleep …

Member Avatar for thekashyap
0
137
Member Avatar for kristo5747

After running the command [CODE] find . -name "R*VER" -mtime +1 -exec sh -c 'grep -H ^err "{}" || echo "{}:No error"' \;[/CODE] my files look like this [CODE] RRR1~COS~COSMETICS~40048~jgmdtv113~1~P~R22-200~029053662549~20110607~102151.VER No error RRR1~COS~COSMETICS~ETT03~jgm14652.~3~F~R16-500~000907009757~20110607~085109.VER err 3922 [/CODE] Using the tilde (~) symbol as delimiter in the file name, can I extract …

Member Avatar for kristo5747
0
222
Member Avatar for Shreerang

Hey all, I have written a small script to download certain files from an ftp site. I use the wget function.I'd like to get a progress-bar with zenity to show the advancement of the wget function. Can anyone suggest a solution? Thanx, Shreerang Patwardhan.

Member Avatar for Kiwicam
1
955
Member Avatar for n3red

Hello, First of all let me say i have very little idea about shell scripting and linux ( ubuntu ). I am trying to write a script where i would give it two arguments two dates in a 29/5 30/5 whitin the console and it would return a list or …

Member Avatar for andrewll2
0
88
Member Avatar for vaibhav1983

Hi All, Small issue while I am tring to cat the contents of the file . The script is posted here [CODE] myvar=`cat orders.0613` echo $myvar [/CODE] The contents of the file orders.0613 contains approximately 200 lines. but when I do echo $myvar the contents are printed in one line. …

Member Avatar for thekashyap
0
96
Member Avatar for k2k

this is perfectly fine. It will grep each of the output, if it != "client" or "-----" then it will be written to the text file. for /F "tokens=3" %%a in ('E:\things\bpplclients') do ( if /I not "%%a" == "Client" ( if /I not "%%a" == "--------------" ( echo %%a …

0
94
Member Avatar for airbourne

I am writing a simple shell script to automate a simple backup of a website and it's database. This is the working code: [CODE]#!/bin/bash # creates a backup of the mysql & webdata for a specific website. TODAY=`date +%A` # these variables cannot contain any spaces and must be modified …

Member Avatar for L7Sqr
0
722
Member Avatar for red_ruewei

Hi all, Sorry if I post duplicate thread. I'm using windows batch program and still very beginner. I'm having a problem to read record from database. I'm planning to automated read folder name(folder name as reference number of project) from specific root folder and compare the folder name whether exist …

0
89
Member Avatar for Freude

Hello everyone, I am trying to use gnuplot for visualization of data stored in a file which is dynamically changed during computations. My aim is visualization of data from this file every several seconds during computations. How can I refresh gnuplot output produced in the bash script (usually i call …

Member Avatar for Freude
0
123

The End.