1,978 Topics
![]() | |
I have the following line of code: [CODE]sed -i "/MatchText/ s/${tgrepLine}/${tNewLine}/" filename.output[/CODE] filename.output contains this: [CODE]blablabla PATH=".:/home/root/bin/:/usr/local/bin/" blablabla[/CODE] Variable ${tgrepLine} contains: PATH=".:/home/root/bin/:/usr/local/bin/" Variable ${tNewLine} contains: PATH="/home/user/bin/:.:/home/root/bin/:/usr/local/bin/" As you can see, both variables contains " (double quotes) If I run the 'sed -i' command, I get an error. I cant use … | |
hi every one.... i was trying to rename the no of files [QUOTE] Like "Prison.Break.S01E01.HDTV.XviD-LOL.srt" to "Prison Break.101.srt" and so on to the following files Desktop/1/Prison.Break.S01E01.HDTV.XviD-LOL.srt Desktop/1/Prison.Break.S01E02.HDTV.XviD-LOL.srt Desktop/1/Prison.Break.S01E03.HDTV.XviD-LOL.srt Desktop/1/Prison.Break.S01E04.HDTV.XviD-LOL.srt Desktop/1/Prison.Break.S01E05.HDTV.XviD-LOL.srt Desktop/1/Prison.Break.S01E06.HDTV.XviD-LOL.srt Desktop/1/Prison.Break.S01E07.HDTV.XviD-LOL.srt Desktop/1/Prison.Break.S01E08.HDTV.XviD-LOL.srt Desktop/1/Prison.Break.S01E09.HDTV.XviD-LOL.srt[/QUOTE] i tried to use [CODE]$mv "Prison.Break.S01E0[1-9].HDTV.XviD-LOL.srt" "Prison Break.10[1-9]" mv: target `Prison Break.10[1-9]' is not a directory … | |
Hi i am new to shell scripting, i need some help please. I have a folder that i am sharing between my linux server and my windows computer. I want to do a shell script that let me know when the size of that folder has passed 110 gb, and … | |
hi everyone... we have to run any python file e.g. show.py at startup..i.e. when OS starts it runs automatically. we are proceeding this way, writing a startup script named forfyp2 ,pasting it in init.d , making it exe using chmod , creating startup links using update-rc.d forfyp2 defaults. After this … | |
Little bit help here i wanna cp the no of files listed in text file... i tried to use [CODE]for songs in $(cat "~Desktop/1/list.txt"); do cp $songs NewSongs/; done[/CODE] but my text file has the path with spaces like /home/rhohit/Music/00 Database/Albatroos/Albatroos/Albatroos - 01.आवाज.mp3 /home/rhohit/Music/00 Database/Albatroos/Albatroos/Albatroos - 02.खसेका तारा.mp3 /home/rhohit/Music/00 Database/Albatroos/Albatroos/Albatroos … | |
Hi folks I am struggling to pass the value of a variable, to be used as an argument for a number of sequentially called python scripts, themselves called from a bash script. Apologies for the pathname chaos. Phase 1: reads the case names from a text file, line by line, … | |
Hello I have a .py file. I am creating a .bat file which when clicked runs the python script & saves the output as a text file in the same directory. I gave this inside the batch file [CODE]%CD%\App1.py > %CD%\op.txt [/CODE] but I am not able to see the … | |
[LIST] I am new at scripting and need help developing a script that will look at a diff file size I've created from the original file and compare the size to the orignal and send a return code of 1 to the /etc/notify if the file is less than 6-% … | |
I have a series of variables like so: $BLACKPASS=7 $BLACKCUTDEPTH=567 $SURFACE=325 NUMBEROFPASSES=$((($BLACKCUTDEPTH-$SURFACE )/$BLACKPASS)) #is 34 Text To Edit: IN; PU; SP6; !PZ-325,200; snip here (inclusive)SP6 is a known/usable starting point VS25; PU9170,-10213; PD9170,-10827; PD7967,-10827; PD7967,-10213; PD9170,-10213; PD9170,-10213; PU9170,-10213; snip stops here inclusive BEFORE the next SPx line SP7; !PZ-325,200; VS8; … | |
Hi guys, i would like to ask that is there any way to check whether an process is ended by using batch scripting? i want to start another program B only when the program A is ended.. Any reply would be appreciated, thank you and have a nice day. | |
Is there any way to launch this .vbs and popup which file to run? Dim WSHShell Set WSHShell = WScript.CreateObject("WScript.Shell") ' open maximized and wait WSHShell.Run "c:\progra~1\la\file1.exe" or run c:\progra~1\la\file2.exe Set WSHShell = Nothing WScript.Quit(0) | |
Hi all can anyone please help me write a shell script for file transfer from windows to unix server and vice versa. i m new to unix shell scripting so kindly bare with the small mistakes tht i mite have made the code is: [CODE]#!/bin/sh filename="sample.txt" user='user' password='passwd' IP='some ip' … | |
For the code snippet I got some error which I can't explicate: [CODE]xyz@lin309-05:~/workspace/os-prj2$ ps -ef | grep node.o xyz 21679 1 0 20:00 pts/1 00:00:00 ssh lin309-05.cise.ufl.edu cd workspace/os-prj2 ; touch /tmp/fu0 ; ./node.o host0 4001 3 2 6 3 lin309-02.cise.ufl.edu:4002 lin309-03.cise.ufl.edu:4003 storm.cise.ufl.edu:4006 host1 host2 host5 host0 xyz 21700 21699 … | |
Hello everyone! I want to use bash from python, however the os.system([I]command[/I]) seems to act only on one command at a time. I want to use complete commands, also containing control flow statements, like If and While, and to call them from python. something like this code in bash: T1="foo" … | |
Hello every one i have small shell script code i want to load it as system boots up,how to do it and where to put that code in new kernel that can take effect as soon as i start my pc..... i have tryed some steps 1] create .sh file … | |
Hi, i am new at shell scripting and i need your help. i have a very big txt file that contains articles,authors,etc. Each article has this form: .I <article's serial number> <article information(in new line)>. What I need is a script tha will split this file into smaller ones.The script … | |
I'm editing the startxwin.bat which came with cygwin What I'm trying to do is, to be able to run a ns simulation automatically when I open the batch file without having to type this command: [CODE]ns example.tcl[/CODE] I'm not sure if I'm on the right track, I've been playing around … | |
Basically searching all files in a directory and locating those that contain a certain word within them. For example, I want to know what files contain the word 'apple', if there is just print the filenames that contain 'apple' somewhere in the text. The only thing I really need to … | |
i wanna create my own commands in linux shell ?what should i do for this ? | |
Hello I have 2 very similar sites, aariclinkdirectory.tk and Abbottlinkdirectory.tk . The 2 sites use the same script, both are link directories, only their names are different. What I did was I installed Aariclinkdirectory.tk successfully, and then copied the db data for this site, and suitably modified the db data … | |
What am I needing to do in order to make this work ? Please advise ? I am getting the $song_title from another part of my PHP I am just setting it as something in this example in order to post what I thought should work ? any help would … | |
Hey guys - i am working off three files that contain information on associates and their sales. The files are: products: (product ID, name, price item) % cat products 103:sway bar:49.99 101ropeller:104.99 104:fishing line:0.99 ... 108:wheel:49.99 111:lock:31.00 102:trailer hitch:97.95 sales: (product ID,num. sold, date sale, associate ID) % cat sales … | |
Hi I've developed a C# program that takes a directory list as its arguments. What I want to do is execute a batch script that would run a command like dir /b and send its ouput to my C# program. I believe that if I were using Linux, my script … | |
Hey all I have a php script that I need to be running 24/7 on a linux platform. I have a dedicated server with centos 5 that I have access via ssh. The php script is written so that it loops indefinitely. However, it inexplicably hangs after 30 - 60 … | |
hi all i want to take a paragraph from a file and append this paragraph after ^L in another fille using shell scripting .............could you help me | |
Hello, I have a file say id.dat In this file each line contains only an id number. I have a group of files (say 1.dat, 2.dat, 3.dat,...., 50.dat). There are unspecified number of records in each of them. If any of these records contain any of the id number present … | |
Hi All, I'm a newbie. I need to know if we can write a script that tracks the number of times an xls file was downloaded in a day. I tried searching many books & websites, but of no use. Kindly show me the way.. Please.. Thanks | |
I have a directlry with log files example (logs/server.log.2009-10-17 or logs/server.log.2009-10-18) 2009-10-17 01:33:00,710 Beginning a.gzip 2009-10-17 01:33:56,704 Completed a.gzip 2009-10-17 01:33:56,704 Beginning b.gzip 2009-10-17 01:34:45,828 Completed b.gzip Now I have a directory which has all these files as well and if you do "zcat a.zip|wc -l you will find the … | |
Hi I need anybody to help me this command in UNIX SHell Scripting. It goes to a website and take a snap shot and stores it in directory. Thanks | |
HI All, I am not able to run a jar file in UNIX. I have a shell script which is throwing this error. [CODE]Exception in thread "main" java.lang.NoClassDefFoundError: dao/Demoface[/CODE] classpath no issues as i am executing all files in the same directory named scripts folder whch has all jars files … | |
Hi, Need some good books for a Linux beginner on the following topics, could anyone please suggest me some good titles based on your experience, Sed & Awk Bash/Shell scripting Thanks a lot, | |
Could anyone help me with shell script witch is analysing errors on server | |
Hi guys, I am Brazillian and i don't know how to speak english very well, but, let's to the question: I need a solution to automatically write a sequence of number to a file, for example, to write automatically to a file the number 1 at 254, this is what … | |
Hello everyone,I need some help over here with grep i have this [CODE]grep -n hello filename grep -v hello filename grep -y hello filename grep -i hello filename grep -w hello filename grep -f file hello filename [/CODE] and i have to execute these commands with a different way. For … | |
Hi, The situation I am in is as follows: There are some computers in a network. They are sharing the same file server ie the same home directory. I am not sure how it works but logging from any machine using the same user name takes me to the same … | |
If I type [CODE]start microsoft word.exe[/CODE] or [CODE]start internet explorer.exe[/CODE] those programs won't start. If I type [CODE]start notepad.exe[/CODE] that program will start because I have the right name. Where would I find on my pc or on the web the correct terms / names to use when referring to … | |
Dear other forum members, I'm writing a script for my homework, but I'm scratching all over my head and still can't figure out what I did wrong. I appreciate if anyone of you can point out my errors. I thank you in advance. [CODE] -bash-3.2$ cat payinfo #!/bin/bash # #This … | |
Hi, I am very new when it comes to batch files and I need to copy some files from a directory to another on a windows 2003 server. I have writeen a simple batch file which looks like this: [code]@echo off SET Day=%date:~0,2% SET Month=%date:~3,2% SET Year=%date:~6,4% SET cdate=%Year%%Month%%Day% SET … | |
Hello, I am new to shell scripting and am having some trouble writing a script that will work the way I want it to. I am good at the one liners, but when I try to string them together I get errors. I have a ftp server that will trigger … | |
What I am trying to do is use to retrieve information from a .txt file and use it in a drop down menu. I am using Cgi and not sure exactly how you do it. This is the shell script that will abstract the information I need for the drop … | |
My professor wants us to write a script that will do the following: -Catch him online and output the time/day -Where did he login, ie College or Home (ip address provided is ok too) -What was he doing The crontab should run every 30 mins and automatically email him all … | |
I need to grep a line from a text file, and delete the fourth and fifth field. then save it back to the text file. If that wont work I could also grep the line, and delete the first number and everything after it on that line. Both would accomplish … | |
Hey guys, Im in a basic programming class. Mainly using VBS scripting nothing else on Windows XP. All of the sudden my prof gave us this assignment for shell scripting. I don't know hardly anything about this. Objective: Create a single shell script in Windows/Linux that will do (all) the … | |
I'm having trouble with some syntax errors, and also wanted to get an opinion of what I've written will work as needed. I'm writing an awk report script to organize data from a file and calculate the amount of sales. There are 3 kinds of lines that we will need … | |
Hi, I urgently need help with an assignment I must complete by tomorrow. I started Bash Scripting yesterday so am a complete newbie. I don't have time to teach myself Bash scripting so please don't redirect me to some tutorials. The assignment I have to do involves the following: the … | |
Hi All, Please advise.. I need to create a script that keeps track on the number of times a file is accessed in a day. Can we use events/triggers if any.. If a file is accessed, then event should increment the count variable. I need to know more on events/triggers … | |
I need to remove all lines that contain spaces in a file. I know very little bash. Any help would be greatly appreciated. | |
i have a file a.txt which contains "ysm.set.ac4-qa.sds.audit add yinst setting yti. YTI_ HOST_OVERRIDE =qa-sav-midas-002.ysm.ac4.yahoo.com" I have variable STR which is dynamically assigned the value "HOST_OVERRIDE=qa-sav-midas-002.ysm.ac4.yahoo.com" I need to grep $STR on the file a.txt as `grep "$STR" a.txt ` But because of the spaces before =, the line is … | |
Hello! I have another issue that i cant solve. How do i search after a string in a text file and remove it when it get a match? | |
Hello! Im rather new to linux and scripting i have a small question. Will this syntax work read $hitta | grep '$hitta' nummer.txt ;; I was planning to read the input from the user and use grep to find it from the file nummer.txt It dont work so well:) |
The End.