1,892 Topics
![]() | |
Hello! Bit new to this and I am only scratching the surface on programming and scripting so forgive me if this is an overasked question! :) Or if this thread is in the wrong location. I am looking to trigger or autorun (not CD) a .bat to run/start by using … | |
"ps aux" outputs the following as the first line: USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND how can I preserve this line if I do a "ps aux | grep <someuser>" so that I can still see the header for each column? In essence, I want … | |
Hi , I have a excel sheet.in that one column called hardcoded. we have sheet as folllows. Name EMp_ID Hardcoded ---------------------------- ABC 1987870 1. EMP_SAL_CD : "2000","1300","Avg100" 2. DEPT_CD : "Manager","clerk","anlyst" 3. DNAME : "SALES","HR" STU 1909890 1.EMP_SAL_CD : "6000","300","A100" 2. DEPT_CD : "Manr","cle","ant" 3. DNAME : "SALES","HR","STUD" --- --- … | |
hey guys ive been working on this script for this game for like 3 weeks now i just cant get it can someone plz fix this for me its not to far off SetActiveWindow Naruto New Flames 2.8 constants k1 = 0 uparrow = 1 leftarrow = 2 rightarrow = … | |
Hello, How can I do it on a recursive way? (Function ''plus'' needs to call itself) [CODE]#!/bin/bash function plus { let GLOBAL=$GLOBAL+$1 } GLOBAL=0 n=$1 for ((i=1; i<=n; i++)) do plus $i done echo Answer: $GLOBAL[/CODE] Any help is welcome! Regards, trume | |
Hi, I am trying to get my sorting script to work, and add to it. Here is my code so far: [CODE]#/bin/sh echo "Name Exam1 Exam2 Exam3 Total Grade" > final.txt awk -f 9.awk grades.txt | sort +4 -5 >> final.txt[/CODE] and then 9.awk is: [CODE]#BEGIN {printf "Name\tExam1\tExam2\tExam3\tTotal\tGrade";} { if($2+$3+$4>90) … | |
Hello all I am running a shell script.What a need is i want to set a timer which show how much time is elapsed and how much time is left for completing the script. can it possible in Linux shell scripting. | |
Greetings. I am using SED to cleanup files that are laid out like so: [icode] ReceiverID=028936004663 SerialNumber=WD-WCAV95708405 Currenttemp=44C PowerOnHours=3663h ReceiverID=028923894902 SerialNumber=WD-WCAV9A766701 Currenttemp=49C PowerOnHours=2215h [/icode] My boss wants files like this one to be tab ("\t") delimited like so [icode] ReceiverID=...(tab)SerialNumber=...(tab)Currenttemp=...(tab)PowerOnHours=...(newline) ReceiverID=...(tab)SerialNumber=...(tab)Currenttemp=...(tab)PowerOnHours=...(newline)... [/icode] 1) first, I added a newline to mark … | |
Hi all, I am new in shell scripting and I need your help 1. I would like to make a list of files (no folders) of unix system which do not belong to root 2. I would like to make a list with directories of system which the first letter … | |
Hi! I'm new in shell scripting, so please help me with my problem. How can I do a bash script's [B]for loop[/B] to find the smallest number? If I have an example: 1 4 6 23 5 7 100 2 Answer: 1 It needs to be a for loop. Any … | |
This is an assignment question, I know i should do it myself, but believe me i have just learned this subject and couldn't find the answer. Please if someone could give me the answer, i would be greatfull. And please if you could hurry because I have to submit on … | |
Hi All, I have a list of txt files that I need to grep out for specific content and then create individual based on the txt file name. Here's my situation: I have been given a list of txt files, for example file is named cp205.txt, and I want to … | |
how to write a bash shell script called which outputs the calendar for the current month and the following month? | |
Hi all, I have a problem I always though i knew the answer to. I have a variable with spaces and I want to perform an operation on each. VAR="THIS" "THAT" "THIS AND THAT" "THIS AND THIS" for i in $VAR do echo "$i" done I thought that I should … | |
Hi, for i in 84 85 86 87 88 89 90 91 92; do ./runCleanup Session 11${i}; done i tried as we do in perl like for i in 84..92; do ./runCleanup Session 11${i}; done But its showing error. what is the solution. Thanks, Deepak | |
Hello, I have a CSV file like: 01,xyz 02,mux 03,mysite 04,mycarsite 05,etcweb I would like to write a cood the read this csv file and replace the password of the account as such to have formula that contains the numbers above. For example 01,xyz->mypassword01pad 02,mux->mypassword02pad 03,mysite->mypassword03pad 04,mycarsite->mypassword04pad 05,etcweb->mypassword05pad Thank you | |
Hi everybody, I decided to ask it here because i didn't know how to ask it on google, i want to know what does this line do: : ${dummy_msg:="Nothing started."} Thanks. | |
guys i have a serious problem my cmd is not under my control as a virus has taken the power. now i want to format my entire drives completely with some .bat file. i am unable to do it with windows disk coz the virus is very talented to come … | |
I am a novice, so please don't be too technical ! I have written 3 separate scripts which all work OK. I now need to merge them into one big script. I would like to introduce a runtime parameter, to allow me to restart at script2 or script3. I would … | |
Hey guys, So I have a file with a bunch of information with the first line being the julian date. I'm wanting to copy all of the information of the julian date (which there are 288 lines per julian date from readings every fifteen minutes) and copy them and add … | |
![]() | hi guys please help writing this shell script in C..please count2:[code] #! /bin/sh # count2 also increments and appends a value to the numbers file # but only when it can successfully create a new hard link to the numbers file count=0 while [ $count -lt 200 ] # still … |
Hi All, I have a problem. I need to write a shell script to change the password. The user may want to change his own password by this script. He will have to provide the required 3 parameters i.e. old password, new password and retype new password as arguments in … | |
Not sure why my comparisons aren't working between my input (text) and my several char arrays. I'm trying to get the user's input to terminate certain functions as you'll see below. I realise it's not the most efficient code but if there's anything obvious I'm missing please let me know. … | |
Hello, I have a script written the unix shell language (NOT in bash or any other shell, in sh) that prints the mount point of a given usb (i.e, it takes the path of a usb (such as /dev/sdb1) as an argument). Here it is: [CODE] #!/bin/sh # usage: get_mount … | |
Hi All, I have no background in scripting in any of the languages.I am trying to write one awk script which can actually read a csv file and stable sort each column and return the output in pivoted form. So, for the sample csv file below: Akhtar,MNNIT,INDIA Azhar,LU,PAKISTAN Bob,MIT,USA Raj,Purdue,INDIA … | |
Could you please help me, i need to extract the fields which are Highlighted and moreover i want to extract in the following way. starting from the first column i have to go n(say n=13) lines down and extract "Records" field value. [U]P.s[/U] Please find the attached document which clearly … | |
To Chubler XL #!/bin/sh touch fileuseranswer echo "**********WELCOME TO GROUCHO MARX UNIVERSITY**********" echo Username: read i echo Password: read j Username="${i}:{j}" if ( ! grep -q $Username /$HOME/PhaseTest/userinfo ) then echo "Wrong Login/Passwd" exit 2 fi echo echo -e " \c" date QFILE=./questions # max questions max=$(sed 's/^[1-8][0-8]*\. /#&/' ${QFILE} … | |
Hello, I've a script that is launched with a soft link. Inside the script, I need to know where is the script, and I'm using the following : [CODE]SH_DIR = $(cd $(dirname "$0"); pwd)[/CODE] But SH_DIR contains the path of the soft link i.e, I've the soft link like this … | |
I want to change to setting 'Deny access to this computer from the network'. This is under Local Security Settings. I need to remove the guest account from the list. Is this setting stored in the registry and can it be modified with VB script ? Thx, kurt | |
Team, Could you let me know what the below function does which is part of my actual script.. Yeah as per my understanding it checks whether the TAR file has been completed or not.. but what is the 1; does below is it end of line or something other.. CheckRetStat … | |
Hello, I need assistance with a pearl/expect script to change user password on mulitple UNIX/Linux servers. I have one dated 11/16/2006 but it is not working exactly as expected. Was hoping there was an updated version that might assist me? It works as such: passchange.script -cmd "passwd user" -inputfile file_with_listofhosts … | |
Team, I have a shell script which will b run in cron job. On an adhoc basis. The script needs to be run such that the moment it goes to the particular directory. It should adapt to its ownership. But the script which i had shared below is run by … | |
The script below is what I have. It does not block other computers that are not in this firewall Check_Mac list. Where is the mistake? Thanks!!! tuxhats #!/bin/sh IPT="/sbin/iptables" # Change to your server ip like this LAN="10.229.2.0/24" , leave the "0/24" alone LAN="10.229.1.0/24" $IPT -P INPUT DROP $IPT -P … | |
I'm attempting to recreate the Unix shell program "todo.txt" using C++ on Windows. An example use of my program in the Command Prompt would be: [CODE]>todo /A "I like cheese."[/CODE] which would append the item "I like cheese." to the file "todo.txt". In my program, there is a line which … | |
Hi all I hav written a very small shell script in bin bash & its not working. The script is :: [CODE]#!/bin/bash i=1.0 while [ $i -le 3.0 ] do i=`expr "$i + 0.5" | bc`; echo "i=$i" done [/CODE] The error is : [CODE]line 6: [: 1.0: integer expression … | |
How Do I send emails to group of persons daily at 12:00 AM ?? I have a PHP page where I will write code to sending mail. I searched and find CRONTAB (shell scripting), a solution for this. If I want to use CRONTAB shell scripting then How I can … | |
Hi, I am having a lot of issues using grep. I am trying to counts the number of lines which start with the letter “L”or “W” and end with the number 3. I can find and count the lines that start with L or W just fine, but I cannot … | |
In a shell script, I want to 'spool' (record) the shell prompt & command typed alongwith its output into a file. eg: In the script, if I give a 'ls' command, the file should contain: [CODE] <<root@server ~>>$ ls a b c.txt <<root@server ~>>$ [/CODE] i.e. the command as if … | |
I am trying to move the huge no of file into different folder.. the files in the style of "HNI [0-9]{3}.*.jpg" i.e [ICODE]HnI 001.Sunday Party.jpg HnI 002.Car.jpg . . . and so on[/ICODE] I want to place the certian no of files in the single folder like.. .[ICODE]mv file1 file2.... … | |
Hi,I have myfile.csh first second third ..... How can I find how many variables I apply to the file Thanks | |
Hi All, I am trying to write a shell script that filter java exceptions along with stack trace from a log file and also it has to count how many times each exception has occurred in the log file. Please help me in this. The resulting file should be like … | |
Hi, I am running Ubuntu 10.04 LTS, and wanted to install RVM today, I used: bash < <( curl [url]http://rvm.beginrescueend.com/releases/rvm-install-head[/url] ) (NOTE: I already have git-core and curl, etc.) After running that command I get the output in terminal from Wayne, and I added: if [[ -s "$HOME/.rvm/scripts/rvm" ]] ; … | |
My script is as follows : [COLOR="Red"]echo " enter the directory path of file " read DIR_PATH path=$DIR_PATH cd $path echo "">/tmp/df_mac echo " enter the name of file" read EXCEL_FILE echo $EXCEL_FILE src_file=$EXCEL_FILE count=`expr 1` one=`expr 1` while read line do IDX=`expr index $line \/` echo $IDX echo $line … | |
Hello, I have stared at this script for the last two days and am unable to find the cause of my error message. Any help would be greatly appreciated. The script is [CODE] #!/bin/sh for i in '/xxx/*' do if [ -f /xxx/$i ] then HOST='xxx.xxx.com' USER='xxxx' PASSWD='xxxx' FILE='$i' ftp … | |
Greetings everyone, I was looking for some help in creating a seemingly simply backup script. I have two servers, laid out in the same format: Server A: the directories contain all the iterations of a certain type of file Server B: the directories contain only the most recent file. The … | |
I have a text file that contains separate lines where this text will always appear, short_message=<some text>. The <some text> part could potentially be different on every line. What I'd like to do is extract the <some text> text and only that text from the file. I don't want the … | |
What's Up? OK, So I'm making a small batch script, That retrieves the IP of a website, And put it into a variable so we can use it later on. The problem is how do I get the IP of the website into a varible? The way I was going … | |
Does anyone know if its possible to type in a number and get the resulting ASCII characters in a batch file? I think in Unix based machines you type the command then \042 or whatever number you want, but I don't know if you can do it in batch files... | |
So I'm new to python, although not terribly new to programming. I am going through some tutorials, but am having some trouble. I am trying to execute a program from the python shell (using Python 3.1). Right now, I have the >>> prompt. I can't seem to get any program … |
The End.