1,891 Topics

Member Avatar for
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
160
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
150
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
66
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
99
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
94
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
73
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
134
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
123
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
85
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
196
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
126
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
87
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
137
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
147
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
519
Member Avatar for k2k

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 …

Member Avatar for k2k
0
135
Member Avatar for rusman

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 …

Member Avatar for eggi
0
156
Member Avatar for sameer9812
Member Avatar for sameer9812

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

Member Avatar for omrsafetyo
0
60
Member Avatar for rusman

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!

Member Avatar for blater
0
93
Member Avatar for emilio

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

0
53
Member Avatar for karthick01

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 …

Member Avatar for eggi
0
134
Member Avatar for ashikin_8119

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 …

0
72
Member Avatar for axn

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 …

Member Avatar for eggi
0
84
Member Avatar for ymf

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 …

Member Avatar for ymf
0
84
Member Avatar for dlnunez99

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 …

Member Avatar for Aia
0
115
Member Avatar for marcux

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 …

Member Avatar for eggi
0
123
Member Avatar for krammer

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

Member Avatar for ghostdog74
0
198
Member Avatar for k2k

hello, I am writing a script to send email to all the users. Can anyone provide the syntax or internet source in reading line from a dir or text document? if users are under /home like: student1 student2 student3 student4 student5 student6 my try is: #!/bin/sh line =`read` while : …

Member Avatar for k2k
0
105

The End.