1,892 Topics
![]() | |
Hi ALL, I want to print some lines from file like example ===== RECOVER DATABASE ALTER DATABASE OPEN; ALTER TABLESPACE TEMP ADD ALTER TABLESPACE TEMP ADD STARTUP NOMOUNT CREATE CONTROLFILE REUSE DATABASE -- SET STANDBY TO MAXIMIZE PERFORMANCE MAXLOGFILES 16 MAXLOGMEMBERS 5 MAXDATAFILES 512 MAXINSTANCES 1 MAXLOGHISTORY 7260 LOGFILE I … | |
Hi. I'm new to linux. I have a question.... What is the difference between BASH Scripting and AWK? When would I use one over the other? | |
Hi there, I have recently put together a net send messenger in a .bat file for a program of mine. I would like to make it so, if the "net start messenger" line fails/has an error, It echo's " messenger service is currently disabled on your computer. press F1 for … | |
I wrote a post-install script, which is executed after the package installation by command like " pkgadd -d /mypackage.pkg". I also want to read user input in post-install script as follows: [CODE] while [ "$ANSWER" != "y" -a "$ANSWER" != "n" ] ; do echo "Apply changes to database? [y/n]:" … | |
Good day everyone. I'm completely new to scripting. I'm trying to practice in it. I'm using Bash on a SuseLinux 10.3 box. I want to practice by sort of creating my own simple IP Monitoring app that will notify me when somethings down. That said, here's my first simple but … | |
Shell Programming for UNIX/Linux is finally over thank god! C/C++/Perl I hate that shit lol it's over and I learned something. 1&>2 = I dont really know if this is right lol or 1>&2 = Something is redirecting something lol | |
I was wondering how this looks. I am trying to create a script that will produce a text file that has a list of the files in the present working directory. How do you go about testing this script? #!/bin/bash # # Matthew Smith# Comp230 ls >FILE.txt | |
Hello List, I do not have any experiece with the shell scripting. I need the help to solve an issue. This script is calculating the value of Nth day correctly which is just for next one month. Now what I need to do is to calculate the same occurence pattern … | |
Hi, I am creating sed commands based on input file that has some numbers in it. When I run a the following command on command prompt, it gives me desired result. [echo "sed -n '2,$ s/^\(.\{"$i"\}\)\(.*\)$/\1,\2/'"] i.e. value of the variable is replaced and a sed command is generated in … | |
Hi All Anyway to add a note inside the email saying here is your file after attching a file in unix?? For example my script is fine attaching the excel file but i would like a message inside the mail too and not in the subject title. [QUOTE]/usr/bin/uuencode $adhocreport $adhocreport … | |
i using getopts but when i type in the argument it not working. Is there anything wrong wif my script? bcos when i enter bash filename -P -S , i should see "hello" msg but i don. [CODE]#!/bin/bash while getopts "PS" opt; do if [ $# -eq 2 ]; then … | |
Hello ya'll, I stumbled over here looking for some help with Bash shell scripts.. See, the problem was I needed to copy a data DVD into (onto?) the system file space. Since this is a virtual machine, copying a DVD takes a very long time, the drive gets hot, starts … | |
I have to create a Pseudo code for a class that is it's second week (I registered Late) I have no idea what I am doing. I have to create a program that writes a file that lists student ID #'s and their final scores. This is the data I … | |
Is there any function in shell that enable to check for upper or lower case? i would like to check the input argumnets for upper or lower case. | |
i wanted to printout the last entry of the file without passing in any arguments but how can i able to do it? i know how to print out where argument is supplied and doing a grep to match it. example inside the file i have: apple:2:1:3 orange:1:2:3 grape:2:3:4 i … | |
Hi Everyone, Is it possible to convert a .sh script to VBS? If so, how should I go about this pls? The issue is that i have found a script which does exactly what i need, but it is written as a .sh we are a pure windows shop and … | |
This script will show the top 5 processes that are using the most CPU percentage. What i'd like to do is color the process that is the highest, which should be the first line. Does anyone know how to do this? [CODE]#!/bin/bash COL_GREEN='\E[32;01m' ps -eo user,pcpu,pid,cmd | sort -r -k2 … | |
Hi ! I am newish to scripting. I have inherited an Apple Xserve running 10.4.11 server There is a script run each night that creates an zipped archive of some data. These can be quite large so I have to prune them regularly. I need to check that the youngest … | |
I'm trying to add colors to this bash script, can anyone help? [CODE]#!/bin/bash # Script to connect to the sprint network # Colors # ESC_SEQ=“\x1b[“ COL_RESET=$ESC_SEQ“39;49;00m“ COL_RED=$ESC_SEQ“31;01m“ COL_GREEN=$ESC_SEQ“32;01m“ COL_YELLOW=$ESC_SEQ“33;01m“ COL_BLUE=$ESC_SEQ“34;01m“ COL_MAGENTA=$ESC_SEQ“35;01m“ COL_CYAN=$ESC_SEQ“36;01m“ case "$1" in connect) pppd call sprint updetach echo -e $COL_GREEN"**You are now connected to the sprint network!"$COL_RESET … | |
Hi guys, Basically what I want to do is run a series of commands in my batch file, and display stdout to screen as well as saving it in a file. So to set the context.. [code] ::To output to helloworld.txt Echo hello world! > helloworld.txt ::To output to console … | |
This code , which is basically created "createdtxt.txt" text file that writes each files location dir /s/b D:\mypictures\*.JPG >createdtxt.txt would give me a file createdtxt.txt with these lines D:\mypictures\DSC07861.JPG D:\mypictures\DSC07870.JPG D:\mypictures\DSC07871.JPG HOW can i add simple command into this code that would give the name John before each line example: … | |
Hey, I'm trying to unpack certain files from a tar archive - I don't want to unpack all of the 1.2GB file, just a particular bunch of it. I tried an obvious command: tar xvf /u8/sp_archive/2005.tar *1274* All files I want to extract have "1274" in the name; I want … | |
Hi all. I am trying to write a "light" version of srm just as an exercise of shell scripting (started today with this ^^" I have to keep it [B]really[/B] simple) Basically it should just search for a file and, if found, ask for a confirmation before deleting it. Now, … | |
i wanted to check my args wheather is a empty string or -P when i run my code but it prompt an error msg. The error msg say i have an unary operation expected at line 3 and 7. m i doing a wrong way to check for empty argument? … | |
Hi, I have just started off with the shell programming. I need to execute a GDB command from a shell script. I have been trying to get this working from quite sometime but not getting it quite right.I have this specific requirement that i read byte data from a file … | |
hi, can anyone give me a brief example using mailx and heredoc to send an email? [CODE]#!/bin/sh mail -s "subject" target@address >>body hello all, this is supposed to be the body of the mail body[/CODE] -----------------------------------------> i think i need somethink like above code, with mailx instead of mail -s......... … | |
:-/ Hi can nayone help me to write SFTP script to copy files from one server to another sever any help appreciated Thank you Madan | |
[CODE] if [ "$1"="-s" -a -n "$2" ] # if $1 is string "-s" and $2 is not null then string="$2" # then string="$2" else echo "error" exit 1 fi echo $string [/CODE] i expect: foo -not"-s" hi return "error" however,, no matter what i type after the - , … | |
Hello. I have 2 files which, and i want to supress one file against another. for example. File 1 - suplist.txt hello123 chris635 mike822 I then have another file File2 - checklist.txt stephen929 mike822 hiop191 I can see that mike 822 appears in the suppression list so i do not … | |
this is a done version of the previous thread. it concatenate all the arguments if they are not the same... however some case will make it a:a:b:a:b:c i try to change all the : into space and then uniq them out.... but the uniq is not working this way i … | |
I try to simply concat the arguments if they are not the same..... what is wrong with this simple code for concat??? [CODE] #!/bin/sh result=$1 shift while [ "$#" -ne "0" ] do next=$1 if [ $result = $next ] then : else $result="$result $next" fi shift done echo "$result"[/CODE] … | |
[code] Hello, I need to create a shell script to telnet to a remote server. Perform some action and then exit from that server. I am trying with a dummy script: #!/bin/bash telnet 172.11.11.21 8101<dummy.txt exit The dummy.txt contains the password. The script is not working with the port number. … | |
Hi All Anyway of compressing a gzip file down evern further. I have a file which is already compressed by gzip but is till to big to email. Any ideas how to make it even smaller??? | |
hi this is mohanraj,i had completed my MCA(2007 passed out) and my RHCE .I'm in dilema whether to go in shell scripting or system admin.or whether to study some programming languages.so plz take this as a serious message an reply me.plz do favourable needs | |
The code "named mywhich" below does basically the same thing as the "which" command in sh does. however, if i do >mywhich wrongcmd wrongcmd2 wrongcmd3 it will only returns wrongcmd3 not found ...... how do i make it like: wrongcmd not found wrongcmd2 not found wrongcmd3 not found ??? I … | |
hi, does anyone know how to check if certain character is contained in the argument? for example: > foo /home/myname how should I check if the argument contains a "/" character? thanks | |
hi, i had a few unix questions that I am not sure about the answers. if anybody can give a try... that would be great. 1. In sed, when you do pattern matching, the largest pattern is always matched first, left to right. True or False 2. The command tr … | |
first of all, what can i do to make my command works like the "ls, cp, mv" ? I always do vi myScript.sh and then chmod +x myScript.sh and I have to execute it like ./myScript.sh ,,, simply typing $myScript at the command promp will not work. Second question for … | |
I'd like to create a script that will run a command, parse the output for certain fields/words and then email that information to me if it meets simple criteria. For example, when run, the command will output several lines. I'll need to grab the Name: Test1 Type: Windows Active: No … | |
I want to enter a file name and if file name exists, it should print the file else create a new file. Pls help me | |
What command will let me run a script/command on a remote machine? Anything I need to have in place to get this remote execution to work? Thanks! | |
i am trying to synchronize between father process and son process created by fork() command, to print simultaneously. my program is written in c under bash shell. the compile goes ok but when i try to run nothing happens and the program doesnot end. my code is: [CODE] #include <stdio.h> … | |
Hi , Im very new to shell scripting. In our office we use both Linux and Windows platform. We have internet connectivity. The gateway is 192.168.1.1 There is no monitoring tool for us. Im using a Linux machine with fedora 8. I wish to monitor that gateway. I want to … | |
Hi all; Really need your help on writing the shell script based on the condition below. I need to re generate file and display message on the status of the file. I need re-write the file by checking whether the first line starts with '1MBB'. If the first condition fail … | |
display output on one line. this is a exerpt from my kshell script cat <filename> |egrep -v Pattern1|egrep -v Pattern2|egrep -v Pattern3 |egrep -v Pattern3 which displays Name=john, Age=24, Occupation=Sales Name=mike, Age=34, Occupation=Unemployed Name=mike, Age=34, Occupation=Unemployed Name=mike, Age=34, Occupation=Unemployed would like to get em all on one line with or … | |
Hi, I'm going over this topic in unix and i'd be glad if someone could explain this bit of script: [ICODE]sed 's/\(abc\)*/xyz/'[/ICODE] so the input would be [ICODE]abcabcabc[/ICODE] which results in [ICODE]xyz[/ICODE] Also how come 'xyz' doesnt repeat 3 times because the input is 'abc' x 3 ? Thanks in … | |
I am trying to create a simple command menu that runs in a continious loop untill the user enter the exit option. I am recieving a error report that says error on line 10 syntax and unexpected end of file on line 47. Can anyone please help? I have included … | |
Hi all! I am all new to shell scripting. I am trying to make a script that searches for a folder and then adds it to PATH First I am serching for the folder: [CODE]find /usr/local -name "jdk1.6*" -type d[/CODE] If version 1.6 of Suns java is installed I get … | |
I am trying to print a random line from a text file that has 10 lines. The problem that I run into is that it sometimes picks the number "0" which is not a line in the text file. How would I have it pick a random number between 1-10? … |
The End.