1,817 Topics
| |
i have 2 files, one file created on Windows and another was made on Ubuntu, i want to use this command: comm -12 file1 file2 how do i do that? | |
i got a string var=96.33% from 120 how do i get 96.33 from $var? | |
trying to send email from nc nc smtp.gmail.com 587 HELO there 250 mx.google.com at your service STARTTLS 220 2.0.0 Ready to start TLS MAIL FROM:<junk@example.com> connection dies.. whats wrong with the protocol im using?? | |
i want to find the total space used for the files owned by me from my current directory. i have du -sh `find ./ -user $USER -type f` which gives 8.0K ./.a 8.0K ./t 4.0K ./cat/A 4.0K ./a using -s has no effect. using du -sh by itself includes the … | |
I am (student) just switched to linux working on NoC (noxim) simulator in ubuntu 12.04 c++ is supported assignment from university, I want to make a script that call my whole program multiple times (for loop= e.g 10) and want to take average value from the functions that were called … | |
Hi, I have dates like 20130402 (y-m-d i.e 2ndApr13) Dates are 20130402, 20130404, 20130409, 20130412 if date is 20130402 out put is 20130408 , if date is 20130412 output is 201304015 dd="20130402" echo $dd This gives me current dates next monday , date -d "next monday" +%Y%m%d How to find … | |
my input file contais this text DOPC 1024 PW 30903 CL- 1 arg01 1 My output file should be DOPC 1024 PW 100 CL- 10 arg01 1 I have used this following command for the single substitution and it works well. read no_water read length sed s/"PW 30903"/"PW $no_water"/ arg01.top … | |
Hi, I am trying to write a small shell script that will take user input on SVN branch and validate that the requested branch exists in SVN. And then continue with other operations if the branch is valid. I tried the following but seems its not working right: VALID_BRANCHES="4.2.1 4.1.0 … | |
$ awk -F ":" 'NR!=1 {print $1}' test1.txt what does this mean?? especially ":"?? | |
i am a beginner. i need online tutorial for shell scripting. there are many on the web.. which one to choose?? | |
Hello I'm writing a script to get content of web pages on different machines and compare them using their md5 hash hear is my code #!/bin/bash # Cluster 1 CLUSTER1_SERVERS="srv01:7051 srv02:7052 srv03:7053 srv04:7054" CLUSTER1_APPLIS="test/version.html test2/version.html test3/version.jsp test4/version.html test5/version.jsp" # Cluster 2 CLUSTER2_SERVERS="srv01:7055 srv02:7056 srv03:7057 srv04:7058" CLUSTER2_APPLIS="test/version.html test2/version.html test3/version.jsp test4/version.html" # … | |
Good Morning, I'm new to Powershell and i'm attempting to create a script which will copy a folder to a spesific directory on an FTP site. I did some Googling and all I seem to come up with are ways to copy the folder contents, but not the folder itself. … | |
I have been working with web traces and i need to change a particular format of the web trace to another. for example from cs21 793468639 122791 173 icons-html/HomePageIcon.gif ALT=" 0 0.0 cs21 793468639 122791 173 icons-html/HomePageIcon.gif ALT=" 0 0.0 cs21 793468639 122791 173 icons-html/HomePageIcon.gif ALT=" 0 0.0 to cs21 … | |
Hi, I'm trying to output the return result on terminal by using >; however, I realized that it will overwrite the previous results. I'm wondering if there's a way to append the result to the file instead of overwriting it. So far this is what I have: FILENAME=$1 while read … | |
I made a mini compiler to help compile C code easier on linux machines with bash #!/bin/bash function project_menu { header echo "Edit project: $1" dir echo "1) New file" echo "2) Edit file" echo "3) Compile file" echo "4) Run Project" echo "5) Compile & Run Project" echo "6) … | |
I know the way to read line by line: FILENAME=$1 cat $1 | while read LINE do echo "$LINE" done but what if I have something like "Type \t Value" in each line that I need to separate them in LINE. An example will be something like Integer 2 String … | |
In a Telnet program, the output of command doesnt fit the screen. How can i see that? | |
Hi, I'm trying to run my script but is not working for some reason the functions is not working at all. Anyone willing to help me to find out the error. Thank you. #!/bin/bash DATE=$(date +"%m_%d_%Y"); turn_off_services() { echo -e "\n## Remove unnecessary services" ## Turn off unnecessary services ## … | |
My code is rather basic so excuse my lack of shell scripting experience. I keep getting errors for line 3. I have tried changing "$1" to `echo $1` `cat $1` and even turning the whole line into a variable which i read in another forum and then calling that variable … | |
I have this script that I thougth only deleted stuff more than 90 days old but after I ran it, it deleted pretty much everything on my backup drive. Thankfuly I have another backup drive so I did not lose my backup but I need to fix this so it … | |
I have to write two scripts, one in bash and one in dos. My dos one works perfectly but I'm having trouble with my bash one. The assignment is to make a script that takes a command line argument (from a test script) and return the change. So if the … | |
Hello everyone, i am fairly new to shell scripting so please bear with me. The following script is supposed to read words from a file and depending on the word print different things. However it always prints the default value. It also refuses to work completely if the first line … | |
Today I have finally made up my mind to quit bat scripting and go for powershell... I need to do a quick script bascially trying to looping through a command output.. can anyone shed some light? i tried foreach ($col in 'app-command -argument') { echo $col } well, guess my … | |
I have to run some shell scripts in Windows using Cygwin. I am able to achieve that using %BASH% --login -i "/cygdrive/d/script.sh", where %BASH% is an environment variable in Windows set to C:\cygwin\bin\bash.exe. I have a created a Cygwin environment variable $EXE_PATH = /cygdrive/d/somepath/dir. Inside my script the line is … | |
Hi i am trying to send email using linux mail command, it does not show any error but its not delivering to the recipient, i am using redhat 5.8 and the command i used is echo "Hi" | mail -s 'Hi' username@gmail.com do i need to configure any redhat file … | |
In the following script I can't get the variable STARTPOINT to increment by 3 each time through the loop. I con't get it because the variable NUMBEROFGROUPS is incrementing by -1 each time and both increment lines look identical to me. #!/bin/bash set -x leading_zeros() { local NUM=${1} local NUMBEROFDIGITS=${2} … | |
Hi, I have a log file contain 28 lines, 1-I need to grep the line with the size next to that i need to grep the name from the line Example: Size element 1. 906K ykms2 2. 1.2M ykps1 2-if one or more of the lines are missing I need … | |
Hi, I would like to write a script to scp files from 1 server to other but the problem is if scp fails maybe because of server crash or somthing like that, i would like to start scp from the last file. i dont want to copy all the files … | |
Hi, I am creating a program that will validate if the user input date is correct. My problem is checking the month, 1. Is it possible to save the all the months in an array and then check the array if the user input is correct. 2. How can it … | |
The following line of code should result in GROUPS holding a number from 1 to probably 4 or 5. I need the next line to simply add 1 to whatever this lines results to. I've tried a lot of tings in bash but I can't make it happen. Any ideas? … |
The End.