1,978 Topics
![]() | |
Hi I wrote a script for class that took one specific file as an input. Ideally, it should be able to take any file as an input. How do I do that? Someone suggested using $@ since is a global variable but I'm kinda confused on how to implement it. … | |
I have a directory with a bunch of stuff in it. when you say rm -r "the directory" you have to say yes,yes,yes,......20 times. Is there a script for just having the answer to all "are you sure you want to delete ...?" be yes? any scripting help, im new. | |
im reading a character given by the user through the keyboard . now ,what is correct : if ($gramma == s) then OR if ($gramma == 's') then where s is supposed to be the character given by the user . if its not any of that whats the correct … | |
[CODE]myuser@linux:~/Desktop$ gcc -nostdlib -Wl,-dynamic-linker,/home/myuser/Desktop/ld-linux-x86-64.so.2,-rpath,/home/myuser/Desktop libc.so.6 libgcc_s.so.1 simple.c myuser@linux:~/Desktop$ ldd a.out linux-vdso.so.1 => (0x00007fffbf5ff000) libc.so.6 => /home/myuser/Desktop/libc.so.6 (0x00007f308b7ae000) libgcc_s.so.1 => /home/myuser/Desktop/libgcc_s.so.1 (0x00007f308b598000) /home/myuser/Desktop/ld-linux-x86-64.so.2 => /lib64/ld-linux-x86-64.so.2 (0x00007f308bb11000) myuser@linux:~/Desktop$ [/CODE] Which ld is being used, the one on the Desktop or the one in /lib64 ? What options do I have to use … | |
Hi all, I was asked to write a shell program in c in unix....basically what i would like to include are the use of dup2 to implement redirection ( < or >) and the use of dup2() and the pipe() system call to implement the '|' symbol on the command … | |
Hi.. I am a total newbie to writing scripts. I am trying to execute a program through a script, but I keep getting 'unexpected end of file' error. [ICODE] q=1.170 while [ $q -lt 1.405 ]; do ./a.out $q q = $(($q + 0.005)) done [/ICODE] Please tell me the … | |
hello i know only shell use but i dont know to program and where to program iam very interested to study about that please show me some links or books where i have to start .iam a absolute beginner please guide me | |
script to specify the name of the user to be checked, the frequency in seconds at which the script should check. If a checking frequency is not specified, it should default to 60 seconds So far I have got [CODE] frequency=$0 user=$1 #!/bin/sh while [ $* -gt 60 ] do … | |
I am working on a project using HTML, PHP, and LINUX shell commands to create a dynamic web page but I seem to be having some trouble figuring out how to run the .cgi file with the shell commands in it using either HTML or PHP (if they are both … | |
Hi All, The command is perfectly working in a Linux machine, but getting a filecopy failed error in windows machine. copy scp://user@ipaddress/sourcefile loca:///destination I guess we have to specify the domain name also in the windows server, as the username is domain/user. Please help. Any other option other than scp. | |
Hi everyone, Here is my problem: I have different data files each with several columns and row of data. datafile1 , datafile2, ... Now I need to do some simple math procedure of this data files, Lets say I need to add the 3rd column of datafile1 to the 2nd … | |
Hello everyone. Let's say i have 2 scripts called "fill_cup.sh" and "empty_cup.sh" and i create a 3rd script "cup.sh". How can i run/execute the scripts "fill_cup.sh" and "empty_cup.sh" in the script "cup.sh". I tried with sh fill_cup.sh and ./fill_cup.sh but it doesn't work. for example Script cup.sh #!/bin/sh [CODE]echo enter … | |
Does anyone know how to use awk to print every 3rd line from the 1st line and including the 1st line? 1st .. 3rd .. .. 3rd .. .. 3rd soemthing like this? the closest I could get was below, but it dosn't go beyond the 3rd line.. any ideas? … | |
I need to know how to copy some folders not all from a source tmp/folder. I'm new to python and I want to better understand python. I can't use copytree because I don't wish to copy all folders. I want to be able to pick the folders I want to … | |
me and my team working on a project called Stealth Hunter, Summarize about our project: Stealth Hunter is a thief catcher, It will silently take a snapshot of user using a stolen notebook or pc with webcam and send the information via email. how it work is: The scripts will … | |
Hi, How good is the TCL scripting language? Is it a hot trend in market? What are the jobs prospectus after learning this language? | |
Hi I have a folder and its contain 5 text files. My question is How can I navigate to folder and read two first line of the txt files in folder with python scripts? I will be very greatful for your help. Reagards Tony | |
Hello, I need help making my shell in c. The shell needs to ignore spaces, this means that you can put the spaces you want an the command needs to work, I already resolved that problem, the next problem is that if you put ; two commands need to be … | |
i havae got a ubuntu machine .I typed in ftp in the command and it comes as ftp> then it ask for connection .I googled it and found that i have to give an address for it. Under one forum i found that the address lies in the /etc/hosts file … | |
Hi, Can someone create a short code that will rename a files extension in a sub directory using a command line option -r? So if i have a file a.txt in folder called loc. I enter this "change -r txt doc" and the file will become a.doc in the loc … | |
Hi all, I have a file .c and I would like to format the comments of file like that : /** Comment */ with a sed script The comments in my file is /* comment 1 */ /* comment 2 */ /** comment 3 */ I know to format file … | |
I dont know shell scripting, It will be great help if someone help me in writing the script for below requirnment Requirnment: I have a file in which sql quires are written.I have to replace content of that file. sql file looks some what like below [CODE] #partial content of … | |
Hello, I am new to this codding stuff and I am only doing it for fun (personal little project) and for learing as I am not programer in any language apart from knowledge in shell scripting :( Anyway after a few weeks looking at examples and searching the net and … | |
Hi. I'm wanting to append some information to a file, which is found in a different file. I have simplified the problem using animals. Here is the basic code to add the line to the file: [CODE]grep "some important info about rabbits" rabbits.data >> rabbits.txt[/CODE] Very simple, but this must … | |
i, Here is the scenario I'm dealing with: My company has a bunch of old servers and workstations that have data on them that I need to copy to a "drobo" (multi-storage device) and eventually send the storage unit to someone else. I have a list of "contract numbers" that … | |
Hi, I use a command with awk in bash shell so as to extract info from a file. [CODE]awk -F'[=,: ]' '{print /uid=/?$4:(/^telephoneN/)?$2:$3}' 1.txt[/CODE] the output is something like aaaa bbbb cccc dddd eeee ffff gggg tttt I would like to write this output in a file 2.xml [CODE]<xml> <name>aaaa</name> … | |
Currently i am trying t figure out a simple straight forward way to back-up all the websites on my server to another server, with history/changes ( in a SVN way ). 1. I upload a file to the main server. 2. A second copy goes to the backup server. 3. … | |
Hi- Was wondering if I could get help with a shell script I am writing to read in 10 -20 directories from a filesystem and then pause, press any key and then read in another 10 or 20 directories and pause again until I read them all. Here is my … | |
Hi, I can not create executable code by using a makefile.How can I generate the executable code.I wrote this lines into my makefile and in the terminal I wrote make but I can not do it.Please help me. myprog : myprog.o mylibrary.o gcc myprog.o mylibrary.o -o myprog myprog.o : myprog.c … | |
Hello, i have a problem and need your help i have a text file generated automatically from a script , but the result in the script is not ordered in a readable way, so i need your help to fix it using a shell command the text file contain data … | |
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 … |
The End.