Posts
 
Reputation
Joined
Last Seen
Ranked #3K
Strength to Increase Rep
+7
Strength to Decrease Rep
-1
52% Quality Score
Upvotes Received
6
Posts with Upvotes
5
Upvoting Members
6
Downvotes Received
6
Posts with Downvotes
6
Downvoting Members
4
6 Commented Posts
0 Endorsements
Ranked #569
~35.6K People Reached
About Me

Shell programmer and author, web designer and coder, cryptic cruciverbalist, chess instructor

Member Avatar for larin83109

Hello again dear Daniwebians, I am asking for some ehlp again. I wrote a littel cript as part of my assigment. My script does what it is suppose to do, but when I run it, it does not end on its own, I have to stop it by "killing" the …

Member Avatar for cfajohnson
0
271
Member Avatar for mkoliwad

Hi All, I need your valuable suggestion as how to sort the log files based on timestamp. Below is the sample log content. string May 28 22:07:48 2015 Log data string May 28 22:07:48 2015 Log data string May 28 22:07:48 2015 Log data I would like to sort based …

Member Avatar for mkoliwad
0
232
Member Avatar for whizkidash

Team, Presently i have some 20 files which i need to copy and store in the common directory. below is the example: script name: dir.sh cp /tmp/abc /home/abc/xyz cp /tmp/def /home/abc/xyz cp /tmp/hij /home/abc/xyz The above script is run, it copies the source files on the destination directory(xyz), wanted to …

Member Avatar for cfajohnson
0
447
Member Avatar for chriswelborn
Member Avatar for Akshay nand

Write a shell script, guess.sh that implements a simple number guessing game. When run, the shell script prompts the user to guess a random number between 0 and 100. If the user guesses incorrectly, the script prompts the user “Guess higher” or “Guess lower” as appropriate and allows the user …

Member Avatar for cfajohnson
0
136
Member Avatar for spowel4

I am defining the following variables inside a bash script (note: I ultimately want to pass these values to the bash script from the commandline but I haven't gotten that far yet): OFS=',' INPUTFILE='~/data.txt' OUTPUTFILE='~/delimited.txt' FIELDWIDTHS='1 10 4 2 2' Next, inside the bash script I'm attempting to call an …

Member Avatar for cfajohnson
0
553
Member Avatar for Cap'nKirk

Hi all, I am having a play around with batch files but have hit a stumbling block. The file returns the contents of an image folder and outputs the results in html format as such: Thumbnail - Filename (usable link) - Creation Date - Modified Date Please bear in mind …

Member Avatar for Cap'nKirk
0
223
Member Avatar for zulabc

I am a beginner for shell script, and I want to know how to check the content of file using if condition I have a files content .txt and what I want is if content of file have .txt; then skip else run code fi

Member Avatar for Snadiger
0
189
Member Avatar for nano72

i have the following scenario want to run the following script with manadory and optional arguments inside a bash script Manadory options are : filename="" port="" optional arguments type -t [A/B] balances -b bal prices -p ./test filename port -t A -b bal my code i have that won't parse …

Member Avatar for cfajohnson
0
733
Member Avatar for lewashby

echo ${NUM:0:2} The above is just an example of the kind of code I'M using. I need a way to represent the end of the string. Is there a way to start from the right side of a line of text instead of the left? What I'M trying to do …

Member Avatar for cfajohnson
0
196
Member Avatar for timetraveller1992

I'm trying to get the date to work properly. The time is 5 pm (1700 hours) now i.e. evening but it always says morning. Here's my code currenthour="$(date "+ %-H")" echo $currenthour if [ $currenthour -gt '12' ] && [ $currenthour -lt '16' ]; then currenttimeofday="Afternoon" elif [ $currenthour -gt …

Member Avatar for cfajohnson
0
180
Member Avatar for johnson gbenga

i need help Am written a script to solve my manual labor of cloning in my environment i want to use for statement to give me this kind of output Script for i in 0-4 && j in a b c d e do echo " $i $j this is …

Member Avatar for cfajohnson
0
179
Member Avatar for raul8

Hi, I simply want to append a string at the end of another string. But instead, it is replacing in the beginning. [CODE]#!/bin/bash str1="/user/test" echo $str1 echo ${str1}/program[/CODE] I tried other techniques too but same result

Member Avatar for Fest3er
0
129
Member Avatar for niyasc

This is the question appeared in our sessional exam related to shell programming What do you mean by $?,$#,$* and $$. Can anyone help me to answer this question?

Member Avatar for adrianfrederic
0
83
Member Avatar for diocode

I'm looking for a command or bash script that will create an index.html file in every directory and subdirectory starting at the current directory. I would like it to prompt to overwrite so I don't delete a good index.html file.

Member Avatar for cfajohnson
0
140
Member Avatar for vip011

HI EVERYONE I would be grateful if someone could help me solving the problem with my CSH file. I am running a simulation which runs with the qsub line in the CSH file and is followed by number of parameter which is required to run the program. But before this …

Member Avatar for cfajohnson
0
162
Member Avatar for maurya10
Member Avatar for gcclinux

Hello, I was wondering if you can help me, I am tryin gto achieve a specif output and I am stuck, any help would be greatly appreciated. [CODE]# cat file 1,2,3,4,5,6 1,,3,4,5,6 1,2,,,,6 # cat file | awk -F, '{print $1,$2,$3,$4,$5,$6}' | awk '{printf("%-1s %2s %2s %2s %2s %2s\n", $1, …

Member Avatar for Fest3er
0
161
Member Avatar for gispe

Hi all!! Im having a problem with my blog desing: thing is I wanna make a 3-column header, but it wont let me. I've tried resizing the header width and then add 2 more columns, and the header was resized, but the other 2 columns didn't appear, so I gues …

Member Avatar for richard_nev
0
265
Member Avatar for dancks

I was supposed to write a program that reads and writes phone numbers of people to a file called phones.txt. The reading part works. The write part doesn't. I tried to use the cat command because I thought doing cat >> file.txt would simply append to a file. What it …

Member Avatar for dancks
0
369
Member Avatar for pfm200586

hello every one I have a problem that drove me crazy last couple days I know I have to use loop structures but I can't figure out how to put the right pieces together. I'm not asking for a complete answer because I want to learn so please help me …

Member Avatar for L7Sqr
0
913
Member Avatar for nikita.

Hi , I want to run a shell script which is present in another user's id after switching it to that user in the same script. but it is not taking it. I m using the su command for that. [code] su - user1 -c "./${HOME}/script1.sh" [/code] it just says …

Member Avatar for nikita.
0
170
Member Avatar for nikita.

I have finally written this code, but the prob with this is that when it is prompting for password it doesnt send any password to the ftp machine, we have to do it manually, but after typing it manually, it take the password line as command and shows that that …

Member Avatar for nikita.
0
203
Member Avatar for aFg3

Hi, I am writing my output using printf(...) procedure. Sometimes I would like to use bold font.like this [CODE]interface(.... turn bold on :-) .....) printf("something in bold\n"); interface(.... turn bold off :-) ....) printf("something not in bold\n"); Is any way to do this?[/CODE]

Member Avatar for cfajohnson
0
4K
Member Avatar for SakuraPink

Hi all, I am trying to write a shell script that submit a couple of jobs .Then in the "job.e.." files looks for the "Finished with all tasks." string and if it exits it continues to lets say step 3 submitting job3 and if not to step 4 and submitting …

Member Avatar for cfajohnson
0
125
Member Avatar for earlybirdsean

What programming language is fit for shell scripting? And could you add a sample code of a shell?

Member Avatar for cfajohnson
0
191
Member Avatar for Shruti4444

Trying to code a shell script for a program testing. i need to check for the existence of particular word in outfile and then proceed further, which i am not able to do. I have wrote the following code. Please tell the corrections.. The control does not pass to the …

Member Avatar for IIM
1
130
Member Avatar for lu2lu

Hi I wrote a script for class that took one specific file as an input. Ideally, it should be able to take any file as an input. How do I do that? Someone suggested using $@ since is a global variable but I'm kinda confused on how to implement it. …

Member Avatar for lu2lu
0
163
Member Avatar for JonSmith

Hi, Can someone create a short code that will rename a files extension in a sub directory using a command line option -r? So if i have a file a.txt in folder called loc. I enter this "change -r txt doc" and the file will become a.doc in the loc …

Member Avatar for JonSmith
0
176
Member Avatar for pichels

Hi- Was wondering if I could get help with a shell script I am writing to read in 10 -20 directories from a filesystem and then pause, press any key and then read in another 10 or 20 directories and pause again until I read them all. Here is my …

Member Avatar for cfajohnson
0
398