Keep getting error "No such file or directory"


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Keep getting error "No such file or directory"
# 8  
Old 02-14-2007
You are creating the file in the directory where you kept your script.Did you keep your script in "/home/nasadmin/quotas_michel" ?
Code:
cat /nas/cifs/usrmapperV3/autoumupload/server_2_newpasswd | cut -d\: -f1,3,5 > userlist.txt

The line which you read from user1.txt is not separated by pipe.Remove unnecessary lines from user1.txt
Code:
echo $LINE | cut -f 2 -d\| | cut -d# -f2
+++ echo Report for user quotas on filesystem user1 mounted on /root_vdm_1/user1
+++ cut -f 2 '-d|'
+++ cut -d# -f2
++ USERID=Report for user quotas on filesystem user1 mounted on /root_vdm_1/user1

Use double quotes
Code:
fgrep "$USERID" /home/nasadmin/quotas_michel/userlist.txt

# 9  
Old 02-14-2007
one step further

Now I get the following output

fgrep \:"$USERID"\: /home/nasadmin/quotas_michel/userlist.txt
+++ fgrep ':5005 :' /home/nasadmin/quotas_michel/userlist.txt
++ UTEMP=
++ ECHO

For some reason the script places the ' ' before and behind the userid
# 10  
Old 02-14-2007
You dont need to worry about that quotes.
Do you have string ":5005 :" in the userlist.txt file?
# 11  
Old 02-14-2007
:5005:

This one exists in userlist.txt file!!
# 12  
Old 02-14-2007
try this
Code:
fgrep ":$USERID:" /home/nasadmin/quotas_michel/userlist.txt

# 13  
Old 02-14-2007
This gives the same result!! When I look at the fgrep command it looks like the script puts a space behind is.

this is what is searches for fgrep '5005 ' userlist.txt
# 14  
Old 02-14-2007
The script does not include space. The space is there in the variable USERID.Try this
Code:
fgrep ":${USERID%% *}:" /home/nasadmin/quotas_michel/userlist.txt

Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. AIX

Apache 2.4 directory cannot display "Last modified" "Size" "Description"

Hi 2 all, i have had AIX 7.2 :/# /usr/IBMAHS/bin/apachectl -v Server version: Apache/2.4.12 (Unix) Server built: May 25 2015 04:58:27 :/#:/# /usr/IBMAHS/bin/apachectl -M Loaded Modules: core_module (static) so_module (static) http_module (static) mpm_worker_module (static) ... (3 Replies)
Discussion started by: penchev
3 Replies

2. Shell Programming and Scripting

Bash script - Print an ascii file using specific font "Latin Modern Mono 12" "regular" "9"

Hello. System : opensuse leap 42.3 I have a bash script that build a text file. I would like the last command doing : print_cmd -o page-left=43 -o page-right=22 -o page-top=28 -o page-bottom=43 -o font=LatinModernMono12:regular:9 some_file.txt where : print_cmd ::= some printing... (1 Reply)
Discussion started by: jcdole
1 Replies

3. UNIX for Beginners Questions & Answers

Grep error "No such file or directory" not solved

Dear all, I run a simple command: grep -f GTEx_snps.txt chr1_r2.txt>chr1_r2_GTEx.txt and got error: "chr1_r2_GTEx.txt: No such file or directory" while "chr1_r2_GTEx.txt is an non-existent file. I google searched some solutions and tried to add -s and --no-messages option grep -s... (2 Replies)
Discussion started by: forevertl
2 Replies

4. Red Hat

Httpd service not starting... Error "Documentroot must be a directory"

I am working with CentOS 6.5. Indeed the document root /var/www/html is a directory and it is a mount point of one file system (not NFS) I observed, if I unmount that file system, I could able to start httpd. Is it restricted in CentOS 6.X that the Documentroot can not be a mount point? ... (5 Replies)
Discussion started by: atanubanerji
5 Replies

5. UNIX for Dummies Questions & Answers

Using "mailx" command to read "to" and "cc" email addreses from input file

How to use "mailx" command to do e-mail reading the input file containing email address, where column 1 has name and column 2 containing “To” e-mail address and column 3 contains “cc” e-mail address to include with same email. Sample input file, email.txt Below is an sample code where... (2 Replies)
Discussion started by: asjaiswal
2 Replies

6. Shell Programming and Scripting

mv error " file is not a directory" ?

Hi; This script part: sudo find *.deb -mmin +10 | sudo xargs mv /var/cache/apt/archives/*.* /var/mobile/Library/iFile/Trash/var/cache/apt/archives/ Always returns : " mv: test.deb is not a directory" Any idea what I'm missing ? Thanks in advance: Pasc (2 Replies)
Discussion started by: pasc
2 Replies

7. UNIX for Dummies Questions & Answers

Unix "look" Command "File too large" Error Message

I am trying to find lines in a text file larger than 3 Gb that start with a given string. My command looks like this: $ look "string" "/home/patrick/filename.txt" However, this gives me the following message: "look: /home/patrick/filename.txt: File too large" So, I have two... (14 Replies)
Discussion started by: shishong
14 Replies

8. Shell Programming and Scripting

awk command to replace ";" with "|" and ""|" at diferent places in line of file

Hi, I have line in input file as below: 3G_CENTRAL;INDONESIA_(M)_TELKOMSEL;SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL My expected output for line in the file must be : "1-Radon1-cMOC_deg"|"LDIndex"|"3G_CENTRAL|INDONESIA_(M)_TELKOMSEL"|LAST|"SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL" Can someone... (7 Replies)
Discussion started by: shis100
7 Replies

9. Shell Programming and Scripting

Delete files older than "x" if directory size is greater than "y"

I wrote a script to delete files which are older than "x" days, if the size of the directory is greater than "y" #!/bin/bash du -hs $1 while read SIZE ENTRY do if ; then find $1 -mtime +$2 -exec rm -f {} \; echo "Files older than $2 days deleted" else echo "free Space available"... (4 Replies)
Discussion started by: JamesCarter
4 Replies

10. AIX

AIX cp error: "A file or directory in the path does not exist"

Hello fellow UNIX fans, I'm running AIX 4.3 and getting an error message “cp: /a/file2.db: A file or directory in the path does not exist” when I run the following command: cp /b/file.db /a/file2.db It stops every time about 95% of the way through the copy process at 1,073,741,312 bits. ... (3 Replies)
Discussion started by: Jackson123
3 Replies
Login or Register to Ask a Question