1,978 Topics

Member Avatar for
Member Avatar for pallavisinha

hi, I am new to scripting. I want to change username and password of a user 500 times. I dont want to use except .....please somebody help. Thanks in advance, Pallavi

Member Avatar for pallavisinha
0
97
Member Avatar for dave_nithis

:) Hi all Am writing a shell script like this: java file1 > output.txt and the output output.txt is used in a html page. Now coming to my problem: This script should run every one hour and when user views the html page,it is showing the partially written output.txt file …

Member Avatar for Salem
0
85
Member Avatar for FractalizeR

Hello. I have the following problem with bash code: [CODE=bash] function fl1_load_modules_and_get_list() ........... for module in $FL_MODULES_TO_PROCESS do source "${FL_MODULE_DIR}/${module}/module.sh" done ........... } function fl1_handle_install { local FL_MODULES_TO_INSTALL=$(fl1_load_modules_and_get_list $1) #Executing pre-install routines for module in $FL_MODULES_TO_INSTALL do fl_mod_${module}_pre_install done } [/CODE] First function is called inside the second one. First …

0
62
Member Avatar for pritishs

Here file abc.txt contents name designation salary ----------------------------------- pritish am 15000 animesh pm 20000 asutosh ceo 30000 Write a shell script to find the name whose salary greater or equal t0 20000

Member Avatar for dave_nithis
0
66
Member Avatar for FractalizeR

Hello. Is there a way in bash to call a function by it's name? For example, I have: MODULE_NAME='test' FUNCTION_NAME='execute_run' How do I call the function with name test_execute_run? I need this to solve the problem of modularizing my bash script. Thank you.

Member Avatar for FractalizeR
0
92
Member Avatar for kmarty009

All, I am relatively new to bash scripting. I have been a Windows Admin for 10+ years and script various tasks in windows, but Linux is a different story. So any help you can provide is greatly appreciated. What I need to do is restart the sshd service on 30 …

Member Avatar for eggi
0
116
Member Avatar for yair7190

hi everyone, im searching for a way to insert several values i get from a command [top |grep root |awk '{print $10}'] to a variable, so that the variable will contain the sum of all values returned. (trying to calculate MEM usage by all root processes ) can anyone help? …

Member Avatar for ghostdog74
0
151
Member Avatar for nihao

Hello everyone: I want to change this date "12 Apr 2006 23:35:47" into "2006-04-12 23:35:47",I have tested lots of parameters of the command "date",but it still not execute UNDER FreeBSD,pls help me,thanks!

Member Avatar for dklima
0
560
Member Avatar for midget

I've been trying to figure this out for months so if someone could tell me how stupid I am that would be great... The first php.ini file works for sharing sessions from domain to subdomain no prob... with the simple inclusion of session.cookie_domain = "mydomain.com" I've tried them both with …

Member Avatar for digital-ether
0
685
Member Avatar for georgegao111

my script try to combine a variable(include space) with another variable, and put them together as a command's parameter, I put "" for the variable which includes space, but it is always broken into two strings and make the command fail. [code] bash-3.1$ ./space.sh ./param -J "t space" sleep 10 …

Member Avatar for georgegao111
0
177
Member Avatar for jack00423

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 …

Member Avatar for pritishs
0
80
Member Avatar for flhtc

Please excuse me if I'm posting something that's been asked 100 times. I've done some searching but can't find what I'm looking for. Also please forgive my greenness, I've only been at this for a week now. I've have extensive experience with shell scripting, some C++, although non of the …

Member Avatar for flhtc
0
114
Member Avatar for cpp_noobsauce

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?

Member Avatar for eggi
0
120
Member Avatar for pure_evil020

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 …

Member Avatar for pure_evil020
0
96
Member Avatar for kingpmp

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]:" …

Member Avatar for eggi
0
124
Member Avatar for MSmith78

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 …

Member Avatar for eggi
0
109
Member Avatar for MAD_DOG

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

Member Avatar for eggi
0
590
Member Avatar for rr4334

Hi. I am trying to create a script that if the new user information is not valid, it will not create the account for the user. and the error should be writte to an error report file. and if the user executes the script incorrectly e.g. without the necessary parameters …

Member Avatar for Jx_Man
0
110
Member Avatar for army88m2

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

Member Avatar for eggi
0
86
Member Avatar for rakaposhi

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 …

0
56
Member Avatar for cliodna

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 …

Member Avatar for eggi
0
92
Member Avatar for skelly16

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 …

Member Avatar for DimaYasny
0
147
Member Avatar for picass0

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 …

Member Avatar for eggi
0
122
Member Avatar for rockhauler

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 …

Member Avatar for rockhauler
0
170
Member Avatar for andy4919

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 …

Member Avatar for andy4919
0
264
Member Avatar for picass0

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.

Member Avatar for ghostdog74
0
2K
Member Avatar for picass0

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 …

Member Avatar for ghostdog74
0
118
Member Avatar for stooartbaby

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 …

Member Avatar for stooartbaby
0
921
Member Avatar for krammer

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 …

Member Avatar for krammer
0
79
Member Avatar for ivorb

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 …

Member Avatar for omrsafetyo
0
87
Member Avatar for krammer

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 …

Member Avatar for krammer
0
182
Member Avatar for Slade

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 …

Member Avatar for eggi
0
204
Member Avatar for leshi

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: …

Member Avatar for eggi
0
83
Member Avatar for omrsafetyo

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 …

Member Avatar for eggi
0
164
Member Avatar for mrboolf

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, …

Member Avatar for eggi
0
152
Member Avatar for packetsmacker

i am trying to find a good scripting language for Mac OS X. I was told python would be a good choice. Before i dedicate my time to learning it I have to find out a couple of things. Can you run python form the GUI? i.e double click it …

Member Avatar for jlm699
0
96
Member Avatar for picass0

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? …

Member Avatar for Salem
0
69
Member Avatar for jsantosh

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 …

Member Avatar for Salem
0
101
Member Avatar for k2k

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......... …

Member Avatar for eggi
0
1K
Member Avatar for madankumar

:-/ Hi can nayone help me to write SFTP script to copy files from one server to another sever any help appreciated Thank you Madan

Member Avatar for madankumar
-1
95
Member Avatar for k2k

[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 - , …

Member Avatar for k2k
0
79
Member Avatar for sjgriffiths

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 …

Member Avatar for eggi
0
137
Member Avatar for k2k

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 …

Member Avatar for k2k
0
125
Member Avatar for k2k

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] …

Member Avatar for omrsafetyo
0
87
Member Avatar for programmer321

[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. …

Member Avatar for eggi
0
207
Member Avatar for skelly16

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???

Member Avatar for masijade
0
130
Member Avatar for D.Mohanraj

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

Member Avatar for omrsafetyo
0
90
Member Avatar for k2k

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 …

Member Avatar for omrsafetyo
0
141
Member Avatar for k2k

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

Member Avatar for k2k
0
150
Member Avatar for k2k

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 …

Member Avatar for masijade
1
533

The End.