Search Results

Search: Posts Made By: visitorQ
55,286
Posted By visitorQ
wow thanks for all the replies! i learned a lot!
wow thanks for all the replies! i learned a lot!
55,286
Posted By visitorQ
thank you so much for the quick reply buddy! i...
thank you so much for the quick reply buddy! i ended up doing this which worked just fine:

#!/bin/sh

for i in `seq 1 ${1}`
do
echo "Welcome ${i} times";
done


but your code seems to...
55,286
Posted By visitorQ
for loop syntax trouble
i don't get what's wrong here. i'm writing a shell script that takes 1 argument (a number) from the command-line, but it's throwing an error:
Syntax error: Bad for loop variable

doesn't make much...
5,166
Posted By visitorQ
i have read permissions for all in the entire...
i have read permissions for all in the entire directory:

throne:/var/www/templates # ls -l
total 108
drwxr--r-- 3 www-data www-data 4096 2007-08-27 05:21 asterisk/
drwxr--r-- 3 www-data...
5,166
Posted By visitorQ
cannot access files in apache
i've never had this happen before, but i cannot access files from the shell in my apache server but i can see them on my localhost and by typing in my ip address in the url i can access and view...
12,168
Posted By visitorQ
shamrock your script works almost perfectly....
shamrock your script works almost perfectly. check out these circumstances:

kumi@throne:atlas/images/photos % ls
313.jpg gallery* Luis Work 017.jpg Luis Work...
12,168
Posted By visitorQ
alright check it out guys. here's the script: ...
alright check it out guys. here's the script:

#!/bin/bash

ls -a1 *.$1 | sort -n | while IFS= read fname ; do
#echo "mv $fname ${i}.${1}"
mv -f "$fname" "${i}.${1}"
((i++))
done...
12,168
Posted By visitorQ
@vgersh, of course! that's why i'm losing files,...
@vgersh, of course! that's why i'm losing files, because it's overwriting existing ones before the loop gets to them. and that's where the sort may be able to help. thanks for clearing that up!
...
12,168
Posted By visitorQ
ya on the second run it's changing the same...
ya on the second run it's changing the same filename to the same filename. the reason why this is important, is because i will be adding images to the same directory later, and i'd like to just...
12,168
Posted By visitorQ
sooo it worked, at first. and i was very very...
sooo it worked, at first. and i was very very excited. but when i tried the same script on the same files, it messed up. it removed like half of my images. at first i had 19 images with random names....
12,168
Posted By visitorQ
to answer your question, because i already know...
to answer your question, because i already know perl and python. i'd like to pick up shell scripting to automate much of my daily-weekly-and monthly tasks.

anyway i tried your script and this time...
12,168
Posted By visitorQ
while i appreciate the effort vgersh, i haven't...
while i appreciate the effort vgersh, i haven't learned much this entire thread. this began as a simple script, but now i can see how it is much more difficult. why wouldn't i just write it in perl...
12,168
Posted By visitorQ
thanks for the advice buddy, but it left me in a...
thanks for the advice buddy, but it left me in a worse position than before:



kumi@throne:atlas/images/photos % ls -a1
./
../
gallery*
.gallery.swp
.jpg
Luis Work 001.jpg
Luis Work...
12,168
Posted By visitorQ
thanks for the link porter. but i'm still having...
thanks for the link porter. but i'm still having trouble with my script:


kumi@throne:atlas/images/photos % ls -l
total 8148
-rwxr-xr-x 1 root root 133 2007-12-12 22:06 gallery*
-rw-r--r--...
12,168
Posted By visitorQ
bump =\ bump
bump =\ bump
12,168
Posted By visitorQ
hey gus. how about i write it for now to just...
hey gus. how about i write it for now to just print out the list of files and the name it will be changed to, first. that way i can see any errors before. i have copies of the photos in a different...
12,168
Posted By visitorQ
i tried yours, reborg, and it kinda messed me up...
i tried yours, reborg, and it kinda messed me up a little.


kumi@throne:atlas/images/photos % sudo chmod a+x gallery
kumi@throne:atlas/images/photos % ls
10.jpg 12.jpg 14.jpg 16.jpg 18.jpg ...
12,168
Posted By visitorQ
thank you for the great replies. so this is how i...
thank you for the great replies. so this is how i think it should go. the logic is there i suppose but the syntax is way off. i'm trying to create this script to work under any conditions (in any...
12,168
Posted By visitorQ
i see. so what's the $1 for? does the shell...
i see. so what's the $1 for? does the shell recognize that as the last characters after the last dot '.' in a filename?

also, i just want it to work for the current directory. so no reason to have...
12,168
Posted By visitorQ
changing filenames in a directory to a number within a loop
hey guys. i'm new to shell scripting but not new to programming. i want to write a script that will take all the files in the current directory that end with a particular filetype and change all...
Showing results 1 to 20 of 20

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