1,817 Topics

Member Avatar for
Member Avatar for neko128

I have the following script snippet, adapted slightly from something I found online a couple of weeks ago: ftp -i -n $HOST >$TODAY/ftp.log <<END_SCRIPT quote USER $USER quote PASS $PASSWD lcd $TODAY mget * quit END_SCRIPT $TODAY is defined as such: TODAY="`date +%m%d%H%M`" It's just to create a unique directory …

Member Avatar for alc6379
0
115
Member Avatar for bhavana

I have a string that looks like this LOCATION="/home/dev/V1.0_MODULENAME_yyyyMMdd_hhss.tar" I would like to parse it such that i get the module name. I tried a k shell script with following commands... MODULE=${LOCATION:20:32} MODULE=${LOCATION#*_} First one doesnt compile saying the specified substitution is not a valid command and the second one …

Member Avatar for jim mcnamara
0
120
Member Avatar for sameet_aset

Im finding trouble writing a script that runs from account A, switches user to B (on same server), performs a few jobs at B, and switches back to A. I want the password for B hardcoded in the script so that it doesnt prompt for one. Someone please help.

Member Avatar for alc6379
0
161
Member Avatar for riverrock

having difficulty with this please help with code if anyone can. ____________________________________ Write a script that plays a ‘double or nothing’ game. The rules are: a bet is laid and the dice is rolled. If it’s an even number you win double the bet. If it's odd you lose the …

Member Avatar for alc6379
0
80
Member Avatar for walawala

Need help on this simple script... I am scratching my head... when I do echo $myhost it returns db3 However, when running the script, the first IF condition is always true... what went wrong? Thanks! Here is the script: myhost=`hostname -s` if [ $myhost='db1' ]; then echo "###############################################" echo "### …

Member Avatar for alc6379
0
161
Member Avatar for zerolimit

I'm basicly trying to write a script that will search through all files in the /home directory and sorting out key words such as kill, bomb, porn ... etc. Then having the output displayed as User "username" has "the keyword" in "filename" I'm pretty new to this and I'm pretty …

Member Avatar for zerolimit
0
111
Member Avatar for abhinav_shah

Hi ! This is the code of a script main.sh [CODE] while read line do chmod +x temp.sh ./temp.sh $line done <test.txt [/CODE] Now this script reads from a file test.txt and calls another script temp.sh. Here is temp.sh [CODE] echo $1 rsh alpha11.xyz.com ls [/CODE] Now the problem is, …

0
116
Member Avatar for Prestwick

Hello all, Essentially a newbie to shell scripting (and Unix/Linux as a whole!) Essentially doing this project for my year in work placement. Essentially it is a script which searches for specific files and backs them up to tape. However I need to modify said script so it can verify …

Member Avatar for Prestwick
0
200
Member Avatar for diddle

Can anyone help me for shell programming basic concept? I want to print the number from 1 to 10 in file1.txt from 2 to 11 in file2.txt from 3 to 12 in file3.txt from 4 to 13 in file4.txt . . . from 21 to 30 in file21.txt How to …

0
75
Member Avatar for diddle

How to store the result of find command in Shell program? I want to store if found then result = 1 else result =0. How to set the result ? My code result = $ (find . -name "doll" ) Can anybody help me? ps. tcsh in cygwin

Member Avatar for diddle
0
148
Member Avatar for debunix

Hi, I have the following task to perform using shell script. The user will provide a [B]directory name[/B] along with a [B]date[/B]. The script will delete all the files in the specified directory that was created earlier to that date. Also it should display the number of files that has …

0
66
Member Avatar for adil_uk

I'd like to create a "shell script" that ease and simplify the use of "Sort" command. Well my shell script should cover the use of " -b -d -f -n -r "options. also my script should do the following: -allows both relative and absolute pathname arguments -process either filename arguments …

Member Avatar for atanu_amd
0
117
Member Avatar for MikeDirnt

Hi Can anyone help me with this. Im new to doing scripts. Thanks I am writing a simple script to cd to another directory. But the directory does not change after running the script. How can i make the directory change after running the script? operator@tiger013s% pwd /export/home/tiger013s/operator operator@tiger013s% more …

Member Avatar for jim mcnamara
0
176
Member Avatar for mfmalik

Hi, I want to access folder on a remote server in a LAN. I just need to access data from there. The script needed to run and create report on server it is resident only data needs to be accessed from other server. Please anyone can help? I have no …

Member Avatar for mfmalik
0
132
Member Avatar for diddle

I need to rename all the files in the current directory,if it contains specific letters using shell programming. For that I used foreach file if (`grep $2 $file`) then mv "$file" newname; in $2 the specific characters are stored. How should I modify this code? Are there any simple way …

Member Avatar for diddle
0
108
Member Avatar for Subterraneus

A script to edit log files, it can remove the username, UID, a specefic string, remove logs and remove the netinfo backup, it's not working. [CODE]#!/bin/bash remove_logs() { find -f /var/log -f /Library/Logs -f /Users/*/Library/Logs \! -iname "*.gz" \! -name ".DS_Store" | while read file ; do sed -e "s/${USER_ID}//g" …

0
112
Member Avatar for javier_ccs

hello, i made a routine in expect that connects via ssh to a juniper firewall, makes a backup of the configuration and saves it into a text file, so far it's working fine, and since it was working so fine i decided to add it to cron in order to …

Member Avatar for javier_ccs
0
123
Member Avatar for skulkarni

Hi, I'm trying to write a shell script that accepts wildcards as arguments. But instead of the wildcards expanding into the list of files from the current directory, I'd like to have them expand into files from another directory. For example, I have a script called test.sh in the folder …

Member Avatar for jim mcnamara
0
170
Member Avatar for GunBao

Hi all, i'm a novice in Shell Programming.. Recently im working on a sch project to create a system which allows user to login, logout, change password, save password.. Some of the requirements are: 1. Check correct userid before asking for password. 2. In unlocking, ask for password only. Userid …

0
54
Member Avatar for darklord

What I am trying to do is to scan a text file word by word and find all words of 4 character or less then output these words to a file, but the problem is I don't know a unix command that can scan the file this way. The Grep …

Member Avatar for jim mcnamara
0
152
Member Avatar for fili00

hey everybody, I just wanted to know how I can print out with awk or others only one line and not a whole column what is made by print$1. I have a data which contains 205 lines and I want for example only the 6th line. I tried with this …

Member Avatar for fili00
0
193
Member Avatar for Manojsah

Hi All, I am implementing simple SHELL similar to bash having functionality that support some BUILT-IN commands like cd, kill, bg, fg, job, wait. It should also support piping and job control. please Guide me how to start this. Thanks manoj

Member Avatar for Manojsah
0
121
Member Avatar for systest

I am trying to find out how to stream a file so that if gives me back how many times a certain field label occurred. File example: Cat black 100 home lost Dog brown 632 street lost Dog black 839 home owned Pig pink 123 mud farm Dog white 345 …

Member Avatar for perniciosus
0
89
Member Avatar for Wolfy

I have these two projects due tomorrow for extra credit in my Unix class and I have no idea how to write them. I really need the extra credit to bump my grade up a little. Any help would be greatly appreciated. Here are the descriptions: Project One: A) Create …

Member Avatar for jim mcnamara
0
96
Member Avatar for gal

I am attempting to write a script that would read entries from a file (one at a time) and for each entry it should cut the given word from caricature 8 till the 3rd from last character. I wrote the following more $TEMP2 | grep join | awk '{print $3}' …

Member Avatar for jim mcnamara
0
68
Member Avatar for raj_thota

Hi, I am Rajesh. I am totally new to shell scripting. I have to prepare a shell script which comapres two directory tree structures ( directory contents comparision is not necessary). for example, suppose I had installed a software system long back and now I want to upgrade that software …

Member Avatar for jim mcnamara
0
371
Member Avatar for alex05

Write a script named killdup. The script sorts all the lines in a file supplied to it as the first argument, and removes duplicate lines. The script stores the resulting output in a file whose name is given by the second argument. I know how to sort it, but how …

Member Avatar for jim mcnamara
0
330
Member Avatar for gundi

Hi! I would like to restore my system to yesterdays, since the changes that I have made has made a bad impact on the htdocs folder, so I rpefere to make a system restore, can you help me plaese..

Member Avatar for chrisbliss18
-1
152
Member Avatar for gg234

Hi, I want to configure my logrotate configuration file as follows we need keep all clients monthly logs to /var/log/apache2/logs folder Under this folder we have different clients directories.Each directory should contain the logfiles that is access.log and error.log files for each folder.Every month end logrotate should run and it …

0
66
Member Avatar for mmiikkee12
Member Avatar for mawe
0
512

The End.