10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hello,
This is really breaking my head. I request you help to solve this problem.
I have a list of files at the source directory (/tmp) as below,
NewTransfer_20131202_APAC.dat
NewTransferFile_20131202_APAC.dat
NewTransfer_20131203_APAC.dat
NewTransferFile_20131203_APAC.dat... (3 Replies)
Discussion started by: sravicha
3 Replies
2. Shell Programming and Scripting
The code at the bottom is a simplified example of what we have.
If I use the following:
&& echo "echo failed"
$? returns 1
When I use
if ; then echo "echo failed" ; fi
$? returns 0
Does anyone know what's wrong with this?
Using AIX 6.1 and KSH
for NUM in 1 2 3
do
... (5 Replies)
Discussion started by: jfxdavies
5 Replies
3. Shell Programming and Scripting
I have a script that reads a file containing a list of server names. It's suppose to loop through the list of names and execute a command on the remote server using ssh. It processes the ssh command for the first server in the list and then exits. Here's the code:
#!/bin/bash
... (2 Replies)
Discussion started by: westmoreland
2 Replies
4. Shell Programming and Scripting
Hi all,
Please guide me writing this script
Follwing is the file which I have created, which contains the files to be copied.
cat system1-dr.txt
/etc/passwd
/etc/shadow
/etc/group
/etc/vfstab
/etc/profile
/etc/default/init
/etc/shells
/etc/dfs/dfstab
/etc/dfs/sharetab... (11 Replies)
Discussion started by: manalisharmabe
11 Replies
5. Shell Programming and Scripting
I want to get newvar outside the while
any ideas?
while read myline; do
var=${myline}
newvar1=$(let "$var")
done
echo $newvar1
I found it its ok now Thank you! (0 Replies)
Discussion started by: sanantonio7777
0 Replies
6. UNIX for Dummies Questions & Answers
Hi
I would like to ssh into serveral servers, print the hostname and do an ls (of files in a certain directory), and add these details to a file.
so i have this:
#!/usr/bin/bash
for host in hostnames_here
do
ssh $host echo "$HOSTNAME" ls /directory_location > ~/new_file_name.txt
... (6 Replies)
Discussion started by: horhif
6 Replies
7. UNIX for Dummies Questions & Answers
can some one please tell me what is the problem with my syntax:confused:
I have 100 files in one folder
1. want to read each of the line by line
2. calculate their number of the words between the first word and the last word of each line
3. create file for each file with number of words... (8 Replies)
Discussion started by: A-V
8 Replies
8. Shell Programming and Scripting
Below is my script that is using to rename the name of file .Here I am using two methods to pass the both arguments wih script name or run the script and give the input one by one.But my issue is I want to rename the name of the file if user select Y(y) then it should rename the file else select... (4 Replies)
Discussion started by: anuragpgtgerman
4 Replies
9. UNIX for Dummies Questions & Answers
spath="/home/user/k/${1}"
dpath="/home/user/seq/Nov17/${1}"
cd $dpath
ls -1 $spath > list
c=1
while read list
newlist=`echo $list | sed 's/.gz//' `
newnewlist=`echo $newlist | sed 's/.fastq//' `
do
echo $c
echo $list
c=$(($c+1)) (6 Replies)
Discussion started by: analyst
6 Replies
10. Shell Programming and Scripting
I need to process a dirtree containing ms office files such that each file is stored as a variable and also, just the file file stem. Why? They will be using as input and output parameters for another script. For example /path/to/second_script -i filename.docx -o filename
Here's what I... (1 Reply)
Discussion started by: graysky
1 Replies