10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
I have this shell script which i am going to package into an application:
cd /Users/william/Desktop Cleaning; mkdir "date"; cp ~/Desktop/* ~/"date";
how would i point to the directory with the name unknown to cp? (2 Replies)
Discussion started by: ws1
2 Replies
2. Shell Programming and Scripting
Hi,
I have file in my $datadir as below :-
SAT_1.txt
SAT_2.txt
BAT_UD.lst
BAT_DD1.lst
DUTT_1.txt
DUTT_la.txt
Expected result :-
should get all the above file in $<Filename>_file.lst
Below is my code :-
for i in SAT BAT DUTT
do
touch a.lst
cd $datadir (1 Reply)
Discussion started by: satishmallidi
1 Replies
3. Shell Programming and Scripting
I am making a script to relocate a project file. I have all of the variables in place and everything is working except:
the first variable changes everytime it passes thru a loop. The second is a constant value.
when I run that it does what I want...but incorrectly. It is finding... (2 Replies)
Discussion started by: gentlefury
2 Replies
4. Shell Programming and Scripting
Im trying to move my files to a variable folder i've just created.
Step 1 is working fine.
mkdir /sdcard/DCIM/Photos/`date +%Y%m%d`
Step 2 is not working
mv /sdcard/DCIM/100ANDRO/*.jpg /sdcard/DCIM/Photos/`date +%Y%m%d`
What am i doing wrong? (2 Replies)
Discussion started by: dihavs
2 Replies
5. Shell Programming and Scripting
Hi,
I would like to parse all the files (*.c and *.h) in the sub-directories and if *.c or *.h files are found I would like to append a string and place it in the same directory. How do I do that?
For example:
I'm gonna operate on dir1 level.
$dir1/subdir1/test.h should be done as... (1 Reply)
Discussion started by: suryaemlinux
1 Replies
6. Shell Programming and Scripting
I am writing a code to append some numbers in the beginning of each line in all the files present in a directory. The number of files are really huge. The files are numbered as 1.sco, 2.sco, 4.sco (Note: 3.sco is missing).
The files currently look like this:
1.sco
2 3
5 6
6 7My task is to... (4 Replies)
Discussion started by: shoaibjameel123
4 Replies
7. UNIX for Dummies Questions & Answers
Hi,
If I have a variable
var1 ='TH 12/1234'
How can I set this too in a script
var1 ='TH 12~1234'
Bearing in mind "/" might be in a difference place each time and that the "/" might not even exist each time
the variable is set.
Thanks (3 Replies)
Discussion started by: belfastbelle
3 Replies
8. Shell Programming and Scripting
Hi all,
I am trying to replace a few lines with other lines of all files in a directory which contain those few lines.
say - there are some 10 files in a dir having the same 4 lines as 1.txt at the starting
1.txt
line 1
line 2
line 3
line 4
....................................... (1 Reply)
Discussion started by: rooster005
1 Replies
9. UNIX for Dummies Questions & Answers
hi
I have a variable like
k=$DESTDIR/$PKG/$VERSION
I want to replace each $ in string k with say "XXX".
so that k becomes like this "XXXDESTDIR/XXXPKG/XXXVERSION"
when I use echo $k | sed -e "s/\$/XXX" it actually passes expanded of variables $DESTDIR, $PKG and $VERSION to sed.
... (10 Replies)
Discussion started by: ashish_uiit
10 Replies
10. Shell Programming and Scripting
Hi Guys,
I have some basic unix knowlege but new to shell scripting. I want to replace variable values in all files in sub-directories. Any sugestion will be helpful.
Example.
Main Dir: X
Sub Dir: X1, X2, X3, X4, X5, X6.... X10
Each sub directory has file which contains variable A = 10. ... (3 Replies)
Discussion started by: newtoshell
3 Replies