1,891 Topics
![]() | |
Not hot on sed.. I have the string <Report name="05/14/14 05:05:53 AM - Report"> in a file. I need to change the date and time part to the current date and time.. any sed regex to match the date format and timestamp? | |
Hi Team, I have a file which contain following data like BKP0000032183140217000019 053IGZYEVSDOX .........field 2....... field3.....field4..... BKP0000032284140217000019CCTP1220 ............... BKP0000032384140217000019CA ..................... each line has 5 fields Now using shell script i am trying to extract field 4 based on condition that line start with BKP and contain code 84 and CA … | |
![]() | I have been beating my head into the desk with this issue, and I don't think it's a simple 'uniq' or 'sort' issue. I have a file, with many duplicate values in them. File ---------- dog dog cat owl owl turkey weasel giraffe giraffe rooster The output I am looking … ![]() |
Hi Team, I am new to shell script, i have knowledge of basic unix command but that doesn't seem working for my current task. Please help me with following problem: I have a xml file for e.g. <ShippingInstructions> <name>Sarah Bell</name> <address>400 Oracle Parkway Redwood Shores CA 94065 USA</address> <telephone>650 506 … | |
Hello All. I have an issue with string manipulation. The file which I am using has two lines : First String: 1 4 Second String: 5 4 What i am trying to do is while reading each line, i would like to store each variable in the line into 3 … | |
Hello all, I am by no means a coder, so hopefully someone has something they would be willing to share that would meet this need. I would like to have a Outlook rule, where: - When an email comes in from a specific account - Has an attachment (PDF, doc, … | |
Hey all, I was wondering if a web page could be opened in Mozilla Firefox using a shell script!..I haven't given it a try as yet...I will also try and if I find a a solution I'll definitely put it up....Till then if someone finds a solution or knows it … | |
@echo off set /p Pause=Before >nul set /p Pause=After (@edit Before `>nul` there supposed to be sign, but it's not visible in post.) What does this script do, is print "Before" wait till user presses enter, "Bleeps" and prints "After", after pressing enter application stops. But output is: '' is … | |
Hi everybody! These days I've been solving the task of sending the bunch of files specified by unix filespec convention (all metacharacters allowed) to the remote host using ftp. I'm thinking of such concept/design, where the main bash script executes the following subtasks: (1) Expansion of command line arguments to … | |
Hi Friends. I am trying to conver the following grep syntax to replace using awk pattern match. Can you please help? tail -F $logFiles | grep " ERROR " | grep -v 'ERROR_SERVER \|Session is null for endpointId\|SYNCED_IN_VIEW_UPDATED'| cut -d" " -f10-14 | awk 'BEGIN..............}' I am seeing some buffering … | |
I want to have one .bash_profile works on multiple platform, ubuntu, debian, redhat, cygwin, osx. So how should I organize .bash_profile? It can be multiple files in some subdir Let me brief you: what i want is a way to organize bash_profile across platforms so I can use one set … | |
Hi, I have a snippet of batch code that searches through a folder and outputs the results one file per line in html format. Code below: @ECHO OFF &SETLOCAL (FOR /f "delims=" %%a IN ('dir /b /a-d /s /n "C:\Documents and Settings\All Users\Documents\My Pictures\Pics & Vids"') DO ( FOR /f … | |
Write a shell script that will take a filepath and a string as command line arguments. The script should find lines which contain the given 'string' in the given file. It should create an output file in "/tmp" directory with the name in the pattern as below. "NN_15Nov2013_12Hrs_32Minutes_20Seconds.txt" | |
Input: Feb 15 2014 09:31:00 ERROR {http--0.0.0.0-0000-000} [54d70-54d70-54d70-54d70-54d70][478-478-478-478-478] JabberServlet - Provisioning exception while parsing protocol Feb 15 2014 09:31:00 ERROR {http--0.0.0.0-0000-000} [54d70-54d70-54d70-54d70-54d70][478-478-478-478-478] JabberServlet - Failed to extract text from response Feb 15 2014 09:31:00 ERROR {http--0.0.0.0-0000-000} [54d70-54d70-54d70-54d70-54d70][478-478-478-478-478] JabberServlet - Error while loading make model Feb 15 2014 10:31:00 ERROR {http--0.0.0.0-0000-000} … | |
Here is my another challenge. When I pass the file name into for loop, I want to get a specific word from the file name and need to pass that as a parameter as well. For eg: When there are 5 files in a folder say Encrypted_abc_1.xml Encrypted_xyz_2.xml Encrypted_hij_3.xml Encrypted_klm_4.xml … | |
Hi, I need to monitor the ip addresses in a server. whenever there is a fluctuation, i need to do some clean up (like restart the server/ reboot the machine) I was able to get a sample cpp program & was able to enhance it to suit my needs. But … | |
I want to find common line in two files and replace the next line of first file with the next line of second file. (sed,awk,perl,bash any solution is welcomed ) Case Ignored. Multiple Occurrence of same line. File 1: hgacdavd sndm,ACNMSDC msgid "Rome" msgstr "" kgcksdcgfkdsb msgid "" hsdvchgsdvc msgstr … | |
Hi all, I want to write a script to do the following job I have a record like day ID var Month 1 11 x March 2 11 y April 3 11 y March 4 11 y April 5 11 y March 1 22 y April 2 22 x march … | |
Win 7 clients, Need to populate alternate IP with current DHCP assignment (I believe everything else will be static). It appears that PowerShell is the only way to get at the alternate IP config variables. We are wrestling with a TechRepublic PS module that could be the modified. I used … | |
By examining the first, third and last (seventh) fields of the /etc/passwd file, determine the userid and login shell for your username, the user root, and the user nobody (yes, there is a system user with the username "nobody"). Create simple files in your home directory, called my.uid, my.shell, root.uid, … | |
First, to explain what I want to do: I have a folder structure like this: BSDS300\images\test\ -which contains JPEG files, and some other files(only .jpg files are of interest) BSDS300\human\color\ -which contains many folders, in which I have .seg files with the same name as the .jpg file Example: BSDS300\images\test\3096.jpg … | |
Write the Towers of Hanoi program as a shell script. There are two basic strategies: run the shell script recursively as $0, or write a recursive shell function. | |
I have no clue to why this isn't working but when I try creating a shell path variable in `/etc/bash.bashrc`. This is my variable `SCHOOL="/home/stephen/Steve's\ Stuff/School"` When I type `$SCHOOL` into the terminal I get `bash: cd: /home/stephen/Steve's\: No such file or directory` | |
Hi Can anyone help me out in this. Actually, I have rows like **Bold Text Here** 50121 abc.com 28/1/2014-12:00:00 52111 xyz.com 27/1/2014-12:00:00 deusr abc.com 26/1/2014-12:00:00 50121 abc.com 26/1/2014-12:00:00 52111 abc.com 25/1/2014-12:00:00 I removed the duplicates based on first column and got the output as 50121 abc.com 28/1/2014-12:00:00 52111 xyz.com 27/1/2014-12:00:00 … | |
Hi all, I am having a play around with batch files but have hit a stumbling block. The file returns the contents of an image folder and outputs the results in html format as such: Thumbnail - Filename (usable link) - Creation Date - Modified Date Please bear in mind … | |
Hello Everybody, I want to do a project on Linux Shell Programming for my final yr.Can any one give me some idea about what kind of projects I should choose (do) which have industrial relevance and certainly helps in campusing. Thaking you, Supra | |
I am a beginner for shell script, and I want to know how to check the content of file using if condition I have a files content .txt and what I want is if content of file have .txt; then skip else run code fi | |
i have the following scenario want to run the following script with manadory and optional arguments inside a bash script Manadory options are : filename="" port="" optional arguments type -t [A/B] balances -b bal prices -p ./test filename port -t A -b bal my code i have that won't parse … | |
echo ${NUM:0:2} The above is just an example of the kind of code I'M using. I need a way to represent the end of the string. Is there a way to start from the right side of a line of text instead of the left? What I'M trying to do … | |
I'm trying to get the date to work properly. The time is 5 pm (1700 hours) now i.e. evening but it always says morning. Here's my code currenthour="$(date "+ %-H")" echo $currenthour if [ $currenthour -gt '12' ] && [ $currenthour -lt '16' ]; then currenttimeofday="Afternoon" elif [ $currenthour -gt … | |
i need help Am written a script to solve my manual labor of cloning in my environment i want to use for statement to give me this kind of output Script for i in 0-4 && j in a b c d e do echo " $i $j this is … | |
Hello, I have one big XML file (600 MB - 850 MB) in format "**cells_yyyymmdd_hhmi.xml**" I would like to specify that everyday i will have new file with new date. So, *there should be general way to read it and cut it*. For exmaple, i have file of 7th January. … | |
Hello, I’m trying to make a powershell script that will copy files to and FTP server, but the destination folder needs to be generated each time the copy starts. In lieu of having a ton of issues trying to copy the source folder onto a remote FTP site using powershell, … | |
Hello I havea simple requirement, But I do not know to execute in ksh. Here is the reqt. I have aseries of jobs that has to run in certain order -First, Run- nuphup Task1.sas & and nohup Task2.sas & parallely(simultaneously) -Second- Wait till Task1.sas and Task2.sas is complete (RC=0) -Third-When … | |
Month CBS GFS HR HR Payroll INCV cbs1 gfs1 hr1 hr2 hrm incv1 Baseline <=97 <=125 >=11 >=19 <=25 10 (6mths) 2013-07 97 89 14 28 30 4 2013-08 58 103 18 6 24 18 2013-09 54 110 11 14 25 17 2013-10 108 129 17 8 23 18 2013-11 … | |
Hello! my Avira just detected an infection with PHP/WebShell.A.1. It resides in C:\Users\Default.Default-PC\AppData\Local\Google\Chrome\User Data\Default\Cache\ and it's called "f_004140". I don't run any web-server on my computer whatsoever so I have no idea how I got it in here. Anyways, here's the "source" of the file. http://pastebin.com/cVzAuS0n https://mega.co.nz/#!gIJFiCZL!JuTagzrj8TI8nMkDZHPD-SRwu8UYs6Z_blMjkEl-aDE ^ The link … | |
Hi, How will i grep for a string which has '/' in it. I have so many script files some are having #!/bin/bash and some are having #!/bin/sh how can i find the scripts which are having #!/bin/sh. Thanks | |
Hi, I have installed ubuntu 11.10 on my PC and the default shell i got was dash i found it out by ll /bin/sh But i could not run some of the scripts and thought of changing the shell to bash. so i did, cd /bin rm dash unlink dash … | |
Hello, Currently I am trying to make Windows Hyper-V and Virtual-Box coexist in the same machine, normally only one hypervisor should be running at any given time but Hyper-V runs all the time. I did some Googling and found this solution (http://derekgusoff.wordpress.com/2012/09/05/run-hyper-v-and-virtualbox-on-the-same-machine/). It works just fine, however I would like … | |
What is the meaning of INSTALL_ROOT_DIR ?= ${INSTALL_DIR}/${TARGET_ROOT_DIR} I googled for ?= in shell script , but none showed up. Thanks ![]() | |
xhi, my task is to make a script, which displays the string read from console input in the form of 1 letters / line only. my code looks like this so far read string hossz=`expr length "$string"` for i in `seq 1 $hossz` do echo `expr substr $string $i 1` … | |
I am trying yo create symbolic link on my mac, but when i try to run i get error saying original item searchMethod cannot be found `$ ln -s '/usr/bin/env python ~/Development/python/searchMethod/python/searchMethod.py' searchMethod` | |
I try to run a script which has #!/bin/bash but i am getting error as "Illegal option --" /bin/sh is not bash , aborting . i try to change the first line to #!/bin/sh this time it is saying x: unexpected operator i tried runnigscript with ./ and sh, but … | |
 I need to create this program for class. I'm not looking for the answer. I'm simply confused on how to create a batch file where I input a number and it gives me an option. Would I use the IF command if so how would I do it. … | |
Hi i need windows command line to find all files that end with .jpg.pdf and remove the .jpg part so it will be pure .pdf at the end, i have following line for /R %DIR% %%i in (*.jpg.pdf) do set without=%i:~0,-8% & rename %%i "%%without.pdf" It should remove last 8 … | |
I am trying to run a shell script at a fixed time with the help of "at" command. But it doesn't seem to work. For example, I created a shell script named as "task" having content: vlc and schedule it to run at 21:52 with the command: $at -f task … ![]() | |
I am trying to search for a shell script if it is running and then assigning the count to a variable. Let the script be ScriptXYZ.sh. I wrote: proc_count=$(/bin/ps -ef | grep ScriptXYZ.sh | grep -v grep | wc -l) The problem that I am facing is that even when … | |
iam doing a python program and the question reads:Write a program that asks the user about textbook prices and reports how overpriced the textbooks are. (You may wish to read this number from the user with the input command. You can round numbers with the round command.) You should match … | |
Hi, I begin study shell programming. I need a basic tutorial or ebook about shell script control MySQL databases (not shell command) please hellp me! | |
i write a following shell script to mount attached usb drives. when i run it it runs only su - command. it ask for type password. but didn't run the other commands.what can i do to run other commands? please help me su- mkdir /mnt/Usb mount -t vfat /dev/sdb1 /mnt/Usb |
The End.