Search Results

Search: Posts Made By: vish6251
Forum: Programming 05-14-2013
2,789
Posted By vish6251
My program was correct but didn't work for some...
My program was correct but didn't work for some strange reasons. After I cleaned it up (added tabs and braces) it worked perfectly.
thank you for reply mate :)
Forum: Programming 05-14-2013
2,789
Posted By vish6251
It worked man thanks a lot!! can you tell me...
It worked man thanks a lot!! can you tell me whats the difference between my program and yours? I tried to put curly braces earlier but didn't work :/
Forum: Programming 05-14-2013
2,789
Posted By vish6251
Print slashes using C
I want to print 4052 slashes using this C program.
#include <stdio.h>

void main()
{
int i;
for (i=0; i<4052; i++)
printf ("/");

}

When i compile this via gcc am getting this error :...
5,011
Posted By vish6251
Please check my script. How can i supply values...
Please check my script. How can i supply values of $f3 to $num?
5,011
Posted By vish6251
The previous suggestion worked for me however,...
The previous suggestion worked for me however, now instead of a txt file with one integer per line, I want read a csv file and apply script to get the statistics of marks. How would i extract values...
5,011
Posted By vish6251
I knew i had to specify a file, then i tried...
I knew i had to specify a file, then i tried adding "num=$1" that didn't work. But your suggestion worked perfectly! thank you!
5,011
Posted By vish6251
Read numbers from file
I am trying to make a script to read marks from a file then find out how many of them are above 40 (passing marks). However my script is getting stuck at "read num". I dont understand whats the...
8,012
Posted By vish6251
wow i didnt knew there are forums which help in...
wow i didnt knew there are forums which help in homework O.o will post there next time.
8,012
Posted By vish6251
yes! yes! that was the last problem now code is...
yes! yes! that was the last problem now code is working as it was designed for. Would you believe i have to submit this code tomorrow as my sem1 assignemnt! phew! what a close call!

Rudi, A BIG...
8,012
Posted By vish6251
still one problem, if selected not to overwrite,...
still one problem, if selected not to overwrite, it doesnt create user_old folder but overwrites existing files.

Do you want to overwrite the file (y/n):
+ read answer
n
+ '[' N == N ']'
+ mv...
8,012
Posted By vish6251
I noticed that and after correction : ...
I noticed that and after correction :
./add_user_rudi userlist /filelist /files /
./add_user_rudi: line 33: conditional binary operator expected
./add_user_rudi: line 33: syntax error near `"0"'...
8,012
Posted By vish6251
please check the attachment
please check the attachment
8,012
Posted By vish6251
following this script, if answer is yes, the...
following this script, if answer is yes, the files are being copied to user dir but if said "No" then no files are being copied or backed up. and no user_old folders are created.
8,012
Posted By vish6251
modified the code as suggested, this is error log...
modified the code as suggested, this is error log :
./add_user_orig userlist /filelist /files/ /
./add_user_orig: line 34: conditional binary operator expected
./add_user_orig: line 34: syntax...
8,012
Posted By vish6251
ok first problem is solved after implementing...
ok first problem is solved after implementing your solution. the script now checks if files are already present, if yes then asks to overwrite, if not then copies new files to dir. however if...
8,012
Posted By vish6251
This is ful log report using ls|wc -w after...
This is ful log report using ls|wc -w after assignment old=_old. Its showing that the dir is empty but still asking to overwrite. Return code after ls|wc -w is also 0.


root@bt:~# bash -vx...
8,012
Posted By vish6251
log showing return code after cd $4$user and...
log showing return code after cd $4$user and old=_old

http://s7.postimage.org/oo0pcfhwb/Untitled.png


If possible, could you please modify the script for me? It would be great help.
8,012
Posted By vish6251
error_log
Heres the error log :

http://s2.postimage.org/guoq1gr2x/error_log.png

i tried putting double quotes but no luck.

PS: neha is first username in userlist.

---------- Post updated at 09:25...
8,012
Posted By vish6251
theres one more problem in the script, whenever...
theres one more problem in the script, whenever we run the script it says "file for user already exists", even if the user is being created for the 1st time. I think the problem is here :...
8,012
Posted By vish6251
I tested the script multiple times, it copies old...
I tested the script multiple times, it copies old files to the user_old dir regardless of the answer chosen by the user i.e. in both cases.
8,012
Posted By vish6251
I have understood most if the script now but got...
I have understood most if the script now but got a doubt in this section :

if [[ $answer -eq y || $answer -eq Y ]]; then
mv $4$user $4$user$old > /dev/null
...
8,012
Posted By vish6251
thanks
thanks i will try and see what i can learn from it.
8,012
Posted By vish6251
Simple script for adding users
Hi guys,

I've a simple linux script (made by my friend), which adds users to the system from userlist file. it also creates user home dir and copies certain files to the directory. To be honest,...
Showing results 1 to 23 of 23

 
All times are GMT -4. The time now is 11:07 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy