小编Apr*_*ors的帖子

在这个声明中使用这个-f有什么用?

我没有-f在本程序中使用此声明.

if [ -f $file ]
Run Code Online (Sandbox Code Playgroud)

if知道为什么我们-f在这里使用?

这是整个计划:

case $ch in
  1)
    echo -e "\n This is File Create Operation"
    echo -e "\n Please Enter File Name:"
    read file

    if [ -f $file ]
    then
      echo -e "\n File already existing!!!"
    else

      touch $file
      echo -e "\n File Created!!!"
      echo -e "\n Created File can be Checked From Following Table"
      ls -t|head -n 15
    fi
  ;;
Run Code Online (Sandbox Code Playgroud)

unix linux shell

1
推荐指数
1
解决办法
72
查看次数

标签 统计

linux ×1

shell ×1

unix ×1